Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eclipse-temurin base image in Dockerfile #1826

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
version: 2
registries:
ghcr:
type: docker-registry
url: https://ghcr.io
username: ${{secrets.CR_USER}}
password: ${{secrets.CR_PAT}}
replaces-base: true
updates:
# For the Schema Loader Docker image, only update the scalar-labs/jre8 container
- package-ecosystem: "docker"
directory: "/schema-loader/"
registries:
- ghcr
schedule:
interval: "weekly"
reviewers:
- "scalar-labs/scalardb"
allow:
- dependency-name: "scalar-labs/jre8"
# For the Server Docker image, only update the scalar-labs/jre8 container
- package-ecosystem: "docker"
directory: "/server/"
registries:
- ghcr
schedule:
interval: "weekly"
reviewers:
- "scalar-labs/scalardb"
allow:
- dependency-name: "scalar-labs/jre8"
# For Gradle, update dependencies and plugins to the latest non-major version
- package-ecosystem: "gradle"
directory: "/"
Expand Down
2 changes: 1 addition & 1 deletion ci/dockerfile_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e -o pipefail; [[ -n "$DEBUG" ]] && set -x

HADOLINT_VERSION="v1.19.0"
HADOLINT_VERSION="v2.12.0"
HADOLINT="${HADOLINT:-docker run --rm -i -v "$(pwd):/mnt" -w "/mnt" "hadolint/hadolint:${HADOLINT_VERSION}" hadolint}"

exec ${HADOLINT} ./Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class CassandraIntegrationTest extends DistributedStorageIntegrationTestBase {
@Override
Expand All @@ -15,4 +17,11 @@ protected Properties getProperties(String testName) {
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}

@Disabled(
"In Cassandra, if an IS NULL condition is specified for a column in a non-existing record, "
+ "the condition is considered satisfied. This behavior differs from that of other adapters")
@Override
@Test
public void put_withPutIfIsNullWhenRecordDoesNotExist_shouldThrowNoMutationException() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;

public class SingleCrudOperationTransactionAdminIntegrationTestWithCassandra
extends SingleCrudOperationTransactionAdminIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return CassandraEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionIntegrationTestBase;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;

public class SingleCrudOperationTransactionIntegrationTestWithCassandra
extends SingleCrudOperationTransactionIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return CassandraEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@ protected Properties getProps(String testName) {
}

@Override
protected String getNamespace1() {
return getNamespace(super.getNamespace1());
}

@Override
protected String getNamespace2() {
return getNamespace(super.getNamespace2());
}

@Override
protected String getNamespace3() {
return getNamespace(super.getNamespace3());
}

private String getNamespace(String namespace) {
protected String getNamespaceBaseName() {
String namespaceBaseName = super.getNamespaceBaseName();
Optional<String> databasePrefix = CosmosEnv.getDatabasePrefix();
return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace);
return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;

public class SingleCrudOperationTransactionAdminIntegrationTestWithCosmos
extends SingleCrudOperationTransactionAdminIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return CosmosEnv.getProperties(testName);
}

@Override
protected String getNamespaceBaseName() {
String namespaceBaseName = super.getNamespaceBaseName();
Optional<String> databasePrefix = CosmosEnv.getDatabasePrefix();
return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName);
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionIntegrationTestBase;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;

public class SingleCrudOperationTransactionIntegrationTestWithCosmos
extends SingleCrudOperationTransactionIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return CosmosEnv.getProperties(testName);
}

@Override
protected String getNamespaceBaseName() {
String namespaceBaseName = super.getNamespaceBaseName();
Optional<String> databasePrefix = CosmosEnv.getDatabasePrefix();
return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName);
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
import java.util.Map;
import java.util.Properties;

public class SingleCrudOperationTransactionAdminIntegrationTestWithDynamo
extends SingleCrudOperationTransactionAdminIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return DynamoEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Override
protected boolean isIndexOnBooleanColumnSupported() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionIntegrationTestBase;
import java.util.Map;
import java.util.Properties;

public class SingleCrudOperationTransactionIntegrationTestWithDynamo
extends SingleCrudOperationTransactionIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return DynamoEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.scalar.db.storage.jdbc;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
import com.scalar.db.util.AdminTestUtils;
import java.util.Properties;

public class SingleCrudOperationTransactionAdminIntegrationTestWithJdbcDatabase
extends SingleCrudOperationTransactionAdminIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return JdbcEnv.getProperties(testName);
}

@Override
protected AdminTestUtils getAdminTestUtils(String testName) {
return new JdbcAdminTestUtils(getProperties(testName));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.scalar.db.storage.jdbc;

import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionIntegrationTestBase;
import java.util.Properties;

public class SingleCrudOperationTransactionIntegrationTestWithJdbcDatabase
extends SingleCrudOperationTransactionIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
return JdbcEnv.getProperties(testName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.scalar.db.api.DistributedTransactionAdminIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.storage.jdbc.JdbcConfig;
import com.scalar.db.storage.jdbc.JdbcEnv;
import com.scalar.db.util.AdminTestUtils;
import java.util.Properties;
Expand All @@ -12,25 +13,28 @@
public class JdbcTransactionAdminIntegrationTest
extends DistributedTransactionAdminIntegrationTestBase {

@Override
protected String getTestName() {
return "tx_admin_jdbc";
}

@Override
protected Properties getProperties(String testName) {
Properties properties = new Properties();
properties.putAll(JdbcEnv.getProperties(testName));
properties.setProperty(DatabaseConfig.TRANSACTION_MANAGER, "jdbc");
properties.setProperty(DatabaseConfig.TRANSACTION_MANAGER, JdbcConfig.TRANSACTION_MANAGER_NAME);
return properties;
}

// Disable several tests for the coordinator tables since JDBC transaction doesn't have
// coordinator tables
@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void createCoordinatorTables_ShouldCreateCoordinatorTablesCorrectly()
throws ExecutionException {
super.createCoordinatorTables_ShouldCreateCoordinatorTablesCorrectly();
}

@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void
Expand All @@ -39,7 +43,7 @@ public void createCoordinatorTables_ShouldCreateCoordinatorTablesCorrectly()
.createCoordinatorTables_CoordinatorTablesAlreadyExist_ShouldThrowIllegalArgumentException();
}

@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void
Expand All @@ -48,15 +52,15 @@ public void createCoordinatorTables_ShouldCreateCoordinatorTablesCorrectly()
.createCoordinatorTables_IfNotExist_CoordinatorTablesAlreadyExist_ShouldNotThrowAnyException();
}

@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void dropCoordinatorTables_ShouldDropCoordinatorTablesCorrectly()
throws ExecutionException {
super.dropCoordinatorTables_ShouldDropCoordinatorTablesCorrectly();
}

@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void
Expand All @@ -65,16 +69,17 @@ public void dropCoordinatorTables_ShouldDropCoordinatorTablesCorrectly()
super.dropCoordinatorTables_CoordinatorTablesDoNotExist_ShouldThrowIllegalArgumentException();
}

@Disabled("JDBC transaction doesn't have coordinator tables")
@Disabled("JDBC transactions don't have Coordinator tables")
@Test
@Override
public void dropCoordinatorTables_IfExist_CoordinatorTablesDoNotExist_ShouldNotThrowAnyException()
throws ExecutionException {
super.dropCoordinatorTables_IfExist_CoordinatorTablesDoNotExist_ShouldNotThrowAnyException();
}

// TODO: implement later
@Test
@Disabled("JDBC Transaction Admin does not support upgrade()")
@Disabled("JDBC transactions don't support upgrade()")
@Override
public void
upgrade_WhenMetadataTableExistsButNotNamespacesTable_ShouldCreateNamespacesTableAndImportExistingNamespaces() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.scalar.db.api.DistributedTransactionCrossPartitionScanIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.storage.jdbc.JdbcConfig;
import com.scalar.db.storage.jdbc.JdbcEnv;
import java.util.Properties;

Expand All @@ -17,7 +18,7 @@ protected String getTestName() {
protected Properties getProperties(String testName) {
Properties properties = new Properties();
properties.putAll(JdbcEnv.getProperties(testName));
properties.setProperty(DatabaseConfig.TRANSACTION_MANAGER, "jdbc");
properties.setProperty(DatabaseConfig.TRANSACTION_MANAGER, JdbcConfig.TRANSACTION_MANAGER_NAME);
return properties;
}
}
Loading
Loading