Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: gradle test

- name: Build binaries
run: gradle binary:runtimeZip
run: gradle binary:runtimeZip binary:runtimeZipWithDrivers

- name: Build docker image
run: 'scripts/docker.sh'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: gradle test

- name: Build binaries
run: gradle binary:runtimeZip
run: gradle binary:runtimeZip binary:runtimeZipWithDrivers

- name: Update Version
run: 'BRANCH_NAME=${{ github.ref_name }} scripts/update_version.sh'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ Follow these steps to get started with RosettaDB:

Run the following command to download and set up RosettaDB:
```
curl -L "https://github.com/rosettadb/rosetta/releases/download/v2.8.5/rosetta_setup.sh" -o rosetta_setup && chmod u+x rosetta_setup && ./rosetta_setup
curl -L "https://github.com/rosettadb/rosetta/releases/download/v2.10.0/rosetta_setup.sh" -o rosetta_setup && chmod u+x rosetta_setup && ./rosetta_setup
```

**Windows (x64)**

Compatible with 64-bit Intel/AMD processors running Windows

```
curl -L "https://github.com/rosettadb/rosetta/releases/download/v2.8.5/rosetta_setup.bat" -o rosetta_setup.bat && .\rosetta_setup.bat
curl -L "https://github.com/rosettadb/rosetta/releases/download/v2.10.0/rosetta_setup.bat" -o rosetta_setup.bat && .\rosetta_setup.bat
```

### 2. Initialize a New Project
Expand Down
91 changes: 91 additions & 0 deletions binary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,94 @@ runtime {
windowsScriptTemplate = file("file:/${resourcesDir}/windows_template.txt")
}
}

// ---------------------------------------------------------------------------
// *-with-drivers bundles: the runtime image plus a pre-filled drivers/ folder.
// ---------------------------------------------------------------------------

def driverDownloadsDir = layout.buildDirectory.dir('driver-downloads')
def driversDir = layout.buildDirectory.dir('drivers')

// JDBC drivers packaged into the bundles. Plain .jar links are copied as is.
// .zip links are extracted keeping only .jar files ('include' narrows that further,
// 'flatten' drops the archive's folder structure).
def bundledDrivers = [
[name: 'Google Cloud BigQuery 4.2', url: 'https://storage.googleapis.com/simba-bq-release/jdbc/SimbaJDBCDriverforGoogleBigQuery42_1.3.0.1001.zip'],
[name: 'Snowflake 3.13.19', url: 'https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/3.13.19/snowflake-jdbc-3.13.19.jar'],
[name: 'Postgresql 42.3.7', url: 'https://jdbc.postgresql.org/download/postgresql-42.3.7.jar'],
[name: 'Redshift 42-2.1.0.30', url: 'https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/2.1.0.30/redshift-jdbc42-2.1.0.30.jar'],
[name: 'DuckDB 1.3.0.0', url: 'https://repo1.maven.org/maven2/org/duckdb/duckdb_jdbc/1.3.0.0/duckdb_jdbc-1.3.0.0.jar'],
[name: 'Databricks 2.6.40', url: 'https://repo1.maven.org/maven2/com/databricks/databricks-jdbc/2.6.40/databricks-jdbc-2.6.40.jar'],
[name: 'Kinetica 7.2.3.26', url: 'https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.2.3.26.zip',
include: '**/kinetica-jdbc-7.2.3.26-jar-with-dependencies.jar', flatten: true],
]

tasks.register('downloadDrivers') {
description = 'Downloads the JDBC drivers packaged into the *-with-drivers bundles'
outputs.dir driversDir
doLast {
def downloadDir = driverDownloadsDir.get().asFile
def targetDir = driversDir.get().asFile
downloadDir.mkdirs()
targetDir.deleteDir()
targetDir.mkdirs()

bundledDrivers.each { driver ->
def fileName = driver.url.substring(driver.url.lastIndexOf('/') + 1)
def downloaded = new File(downloadDir, fileName)
if (!downloaded.exists()) {
logger.lifecycle("Downloading ${driver.name} from ${driver.url}")
new URL(driver.url).withInputStream { input ->
downloaded.withOutputStream { output -> output << input }
}
} else {
logger.lifecycle("Using cached ${driver.name}: ${downloaded}")
}

if (fileName.endsWith('.zip')) {
copy {
from zipTree(downloaded)
include driver.include ?: '**/*.jar'
includeEmptyDirs = false
into targetDir
if (driver.flatten) {
eachFile { it.path = it.name }
}
}
} else {
copy {
from downloaded
into targetDir
}
}
}
}
}

def bundlePlatforms = ['linux-x64', 'mac_x64', 'mac_aarch64', 'win_x64']

bundlePlatforms.each { platform ->
tasks.register("runtimeZipWithDrivers_${platform}", Zip) {
description = "Builds the ${platform} runtime image bundled with JDBC drivers"
dependsOn 'runtime', 'downloadDrivers'

def bundleName = "rosetta-${project.version}-${platform}"
archiveFileName = "${bundleName}-with-drivers.zip"
destinationDirectory = layout.buildDirectory

from(layout.buildDirectory.dir("image/binary-${platform}")) {
into bundleName
}
from(driversDir) {
into "${bundleName}/drivers"
}
filesMatching('**/bin/*') {
mode = 0755
}
}
}

tasks.register('runtimeZipWithDrivers') {
description = 'Builds the *-with-drivers bundles for all platforms'
dependsOn bundlePlatforms.collect { "runtimeZipWithDrivers_${it}" }
}
6 changes: 3 additions & 3 deletions binary/src/main/resources/windows_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ set CLASSPATH=%APP_HOME:"=%/lib/*
set "DRIVERS_PATH=%ROSETTA_DRIVERS%"

if "%ROSETTA_DRIVERS%"=="" (
set "DRIVERS_PATH=%APP_HOME%\drivers"
set "DRIVERS_PATH=%APP_HOME%\\drivers"
)

if not exist "%DRIVERS_PATH%" (
mkdir "%DRIVERS_PATH%"
)

for /R "%DRIVERS_PATH%" %%f in (*.jar) do (
set CLASSPATH=%CLASSPATH%;%%f
call set "CLASSPATH=%%CLASSPATH%%;%%f"
)

<% if ( System.properties['BADASS_CDS_ARCHIVE_FILE_WINDOWS'] ) { %>
Expand All @@ -72,7 +72,7 @@ if exist %CDS_ARCHIVE_FILE% set CDS_JVM_OPTS=-XX:SharedArchiveFile=%CDS_ARCHIVE_
<% } %>

@rem Execute ${applicationName}
<% if ( System.properties['BADASS_RUN_IN_BIN_DIR'] ) { %>pushd %DIRNAME% & <% } %>%JAVA_EXE% %DEFAULT_JVM_OPTS% %CDS_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% -Djdk.tls.client.protocols=TLSv1.2 <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath %CLASSPATH% ${mainClassName} %CMD_LINE_ARGS%<% if ( System.properties['BADASS_RUN_IN_BIN_DIR'] ) { %> & popd<% } %>
<% if ( System.properties['BADASS_RUN_IN_BIN_DIR'] ) { %>pushd %DIRNAME% & <% } %>%JAVA_EXE% %DEFAULT_JVM_OPTS% %CDS_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% -Djdk.tls.client.protocols=TLSv1.2 <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS%<% if ( System.properties['BADASS_RUN_IN_BIN_DIR'] ) { %> & popd<% } %>

:end
@rem End local scope for the variables with windows NT shell
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

allprojects {
group = 'com.adaptivescale'
version = '2.10.0'
version = '2.10.1'
sourceCompatibility = 11
targetCompatibility = 11
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/java/com/adaptivescale/rosetta/cli/Cli.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

@CommandLine.Command(name = "cli",
mixinStandardHelpOptions = true,
version = "2.10.0",
version = "2.10.1",
description = "Declarative Database Management - DDL Transpiler",
subcommands = {
com.adaptivescale.rosetta.cli.DbtCommands.class
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main/resources/drivers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
link: https://jdbc.postgresql.org/download/postgresql-42.3.7.jar
- name: MySQL 8.0.30
link: https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.30.zip
- name: Kinetica 7.1.7.7
link: https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.1.7.7.zip
- name: Kinetica 7.2.3.26
link: https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.2.3.26.zip
- name: Google Cloud Spanner 2.6.2
link: https://search.maven.org/remotecontent?filepath=com/google/cloud/google-cloud-spanner-jdbc/2.6.2/google-cloud-spanner-jdbc-2.6.2-single-jar-with-dependencies.jar
- name: SQL Server 12.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void prep() throws Exception {
@Order(1)
void textExtract() throws Exception {
Database sourceModel = container.getDatabaseModel();
assertSame("Comparing table count.", 26, sourceModel.getTables().size());
assertSame("Comparing table count.", 21, sourceModel.getTables().size());
assertSame("Comparing actor table column count.", 4, container.getTableColumns(sourceModel, "actor").size());
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/github_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ upload_custom_release_file "rosetta-$APP_VERSION-linux-x64.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-mac_aarch64.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-mac_x64.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-win_x64.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-linux-x64-with-drivers.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-mac_aarch64-with-drivers.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-mac_x64-with-drivers.zip" "binary/build/"
upload_custom_release_file "rosetta-$APP_VERSION-win_x64-with-drivers.zip" "binary/build/"
upload_custom_release_file "cli-$APP_VERSION.jar" "cli/build/libs/"
Loading