Skip to content

Commit

Permalink
Revert "WX-1409 Java 17 (#7342)"
Browse files Browse the repository at this point in the history
This reverts commit 0ecbf53.
  • Loading branch information
aednichols authored Dec 14, 2023
1 parent 0ecbf53 commit 3f9ce28
Show file tree
Hide file tree
Showing 31 changed files with 776 additions and 57 deletions.
10 changes: 5 additions & 5 deletions .github/set_up_cromwell_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
name: 'Set Up Cromwell Steps'
description: Specific steps that will set up git secrets, java, sbt, and Cromwell on the local machine.
inputs:
cromwell_repo_token:
description: "As an input to this action, you are required to pass in a token that can be used to authenticate while checking out Cromwell."
cromwell_repo_token: #As an input to this action, you are required to pass in a token that can be used to authenticate while checking out Cromwell.
required: true

runs:
Expand All @@ -13,13 +12,13 @@ runs:
#Allows this github action to use a cache to store stuff like Java and sbt files between runs.
- uses: actions/checkout@v3
name: Checkout Coursier Cache
- uses: coursier/cache-action@v6
- uses: coursier/cache-action@v6
name: Enable Coursier Cache

#Cromwell requires git-secrets be setup. Here, we set up secrets and verify success with a script.
- name: Git secrets setup
run: |
git clone --quiet https://github.com/awslabs/git-secrets.git ~/git-secrets
git clone https://github.com/awslabs/git-secrets.git ~/git-secrets
cd ~/git-secrets
git checkout ad82d68ee924906a0401dfd48de5057731a9bc84
sudo make install
Expand All @@ -44,4 +43,5 @@ runs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 11

5 changes: 2 additions & 3 deletions .github/workflows/chart_update_on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ jobs:
repository: broadinstitute/cromwell
token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # Has to be set at checkout AND later when pushing to work
path: cromwell
- uses: actions/setup-java@v4
- uses: olafurpg/setup-scala@v10
with:
distribution: 'temurin'
java-version: '17'
java-version: adopt@1.11
- name: Clone Cromwhelm
uses: actions/checkout@v2
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docker_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
repository: broadinstitute/cromwell
token: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
path: cromwell
- uses: actions/setup-java@v4
- uses: olafurpg/setup-scala@v10
with:
distribution: 'temurin'
java-version: '17'
java-version: adopt@1.11
# The following invocation should be as similar as possible to the one in chart_update_on_merge.yml
# To state the obvious: This test should not publish anything. It should simply verify that the build completes.
- name: Build Cromwell Docker
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ jobs:
set -e
echo Running test.sh
./src/ci/bin/test.sh
# If a build step fails, activate SSH and idle for 60 minutes
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 60
# with:
# limit-access-to-actor: true
# detached: true
# always() is some github magic that forces the following step to run, even when the previous fails.
# Without it, the if statement won't be evaluated on a test failure.
- uses: ravsamhq/notify-slack-action@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
- uses: actions/checkout@v2

# fetch SBT package
- uses: actions/setup-java@v4
- uses: olafurpg/setup-scala@v10
with:
distribution: 'temurin'
java-version: '17'
java-version: adopt@1.11

# set up SBT cache
- uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=17.0.9-tem
java=11.0.11.hs-adpt
7 changes: 0 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Cromwell Change Log

## 87 Release Notes

### Java 17

As of this version, a distribution of Java 17 is required to run Cromwell. Cromwell is developed, tested, and
containerized using [Eclipse Temurin](https://adoptium.net/temurin/releases/?version=17).

## 86 Release Notes

### GCP Batch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import java.util.concurrent.atomic.AtomicInteger
* > main thread).
*/
object DaemonizedDefaultThreadFactory extends ThreadFactory {
private val group = Thread.currentThread.getThreadGroup
private val s = System.getSecurityManager
private val group = if (s != null) s.getThreadGroup else Thread.currentThread.getThreadGroup
private val threadNumber = new AtomicInteger(1)
private val namePrefix = "daemonpool-thread-"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class CloudNioPath(filesystem: CloudNioFileSystem, private[spi] val unixPath: Un
): WatchKey = throw new UnsupportedOperationException

override def iterator(): java.util.Iterator[Path] =
if (unixPath.izEmpty || unixPath.isRoot) {
if (unixPath.isEmpty || unixPath.isRoot) {

Check warning on line 179 in cloud-nio/cloud-nio-spi/src/main/scala/cloud/nio/spi/CloudNioPath.scala

View check run for this annotation

Codecov / codecov/patch

cloud-nio/cloud-nio-spi/src/main/scala/cloud/nio/spi/CloudNioPath.scala#L179

Added line #L179 was not covered by tests
java.util.Collections.emptyIterator()
} else {
unixPath.split().to(LazyList).map(part => newPath(UnixPath.getPath(part)).asInstanceOf[Path]).iterator.asJava
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final private[spi] case class UnixPath(path: String) extends CharSequence {

def isAbsolute: Boolean = UnixPath.isAbsolute(path)

def izEmpty: Boolean = path.isEmpty
def isEmpty: Boolean = path.isEmpty

Check warning on line 70 in cloud-nio/cloud-nio-spi/src/main/scala/cloud/nio/spi/UnixPath.scala

View check run for this annotation

Codecov / codecov/patch

cloud-nio/cloud-nio-spi/src/main/scala/cloud/nio/spi/UnixPath.scala#L70

Added line #L70 was not covered by tests

def hasTrailingSeparator: Boolean = UnixPath.hasTrailingSeparator(path)

Expand Down
2 changes: 1 addition & 1 deletion docs/Configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ This limit may be configured via the configuration value:

```hocon
yaml {
max-depth = 100
max-depth = 1000
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/Releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Mac users with Homebrew can also get Cromwell with the command `brew install cro
This documentation frequently refers to a "Cromwell jar" with a name like `cromwell-<version>.jar`.
This is the main artifact in Cromwell releases that contains all executable Cromwell code and default configuration.

A distribution of Java 17 is required to run Cromwell. Cromwell is developed, tested, and containerized using
[AdoptOpenJDK 17 HotSpot](https://adoptopenjdk.net/).
A distribution of Java 11 is required to run Cromwell. Cromwell is developed, tested, and containerized using
[AdoptOpenJDK 11 HotSpot](https://adoptopenjdk.net/).

For users running a Cromwell server [a docker image](https://hub.docker.com/r/broadinstitute/cromwell) has been made available.

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/FiveMinuteIntro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
### Prerequisites:

* A Unix-based operating system (yes, that includes Mac!)
* A Java 17 runtime environment
* A Java 11 runtime environment
* You can see what you have by running `$ java -version` on a terminal.
* If not, consider installing via conda or brew [as explained here](../Releases.md).
* We recommend [SDKMAN](https://sdkman.io/install) to install the latest 17 build of [Temurin](https://adoptium.net/temurin/releases/?version=17)
* `sdk install 17.0.9-tem` as of the time of this writing
* We recommend [SDKMAN](https://sdkman.io/install) to install the latest 11 build of [Temurin](https://adoptium.net/temurin/releases/?version=11)
* `sdk install java 11.0.16-tem` as of the time of this writing
* You might need to update the `export JAVA_HOME` in your bash profile to point to your JAVA install location.
* A sense of adventure!

Expand Down
5 changes: 3 additions & 2 deletions project/Publishing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object Publishing {
val additionalDockerInstr: Seq[Instruction] = (dockerCustomSettings ?? Nil).value

new Dockerfile {
from("us.gcr.io/broad-dsp-gcr-public/base/jre:17-debian")
from("us.gcr.io/broad-dsp-gcr-public/base/jre:11-debian")
expose(8000)
add(artifact, artifactTargetPath)
runRaw(s"ln -s $artifactTargetPath /app/$projectName.jar")
Expand Down Expand Up @@ -163,7 +163,8 @@ object Publishing {
val additionalResolvers = List(
broadArtifactoryResolver,
broadArtifactoryResolverSnap,
) ++ Resolver.sonatypeOssRepos("releases")
Resolver.sonatypeRepo("releases")
)

private val artifactoryCredentialsFile =
file("target/ci/resources/artifactory_credentials.properties").getAbsoluteFile
Expand Down
2 changes: 1 addition & 1 deletion publish/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir -p /etc/apt/keyrings
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt update
apt install -y temurin-17-jdk
apt install -y temurin-11-jdk

# Install jq 1.6 to ensure --rawfile is supported
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o /usr/bin/jq
Expand Down
4 changes: 2 additions & 2 deletions runConfigurations/renderCiResources.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</option>
<option name="tasks" value="renderCiResources" />
<option name="useSbtShell" value="false" />
<option name="vmparams" value="-Xms512M -Xmx1024M -Xss1M" />
<option name="vmparams" value="-Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled" />
<option name="workingDir" value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
</component>
</component>
1 change: 1 addition & 0 deletions scripts/docker-compose-mysql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Looking for the MySQL docs? Checkout the [Cromwell documentation](https://cromwell.readthedocs.io/en/develop/Configuring/#database)!
9 changes: 9 additions & 0 deletions scripts/docker-compose-mysql/compose/cromwell/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM broadinstitute/cromwell:develop

RUN git clone https://github.com/vishnubob/wait-for-it.git
RUN mkdir cromwell-working-dir
WORKDIR cromwell-working-dir

COPY ./app-config /app-config

ENTRYPOINT ["/bin/sh", "-c"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
include required(classpath("application"))

# Note: If you spot a mistake in this configuration sample, please let us know by making an issue at:
# https://github.com/broadinstitute/cromwell/issues

call-caching {
enabled = false
}

backend {
default = "Local"
providers {
Local {
actor-factory = "cromwell.backend.impl.sfs.config.ConfigBackendLifecycleActorFactory"
config {
run-in-background = true
runtime-attributes = "String? docker Int? max_runtime = 2"
submit = "/bin/bash ${script}"
submit-docker = "docker run --rm -v ${cwd}:${docker_cwd} -i ${docker} /bin/bash < ${script}"

# Root directory where Cromwell writes job results. This directory must be
# visible and writeable by the Cromwell process as well as the jobs that Cromwell
# launches.
root: "cromwell-executions"

filesystems {
local {
localization: [
"soft-link", "hard-link", "copy"
]

caching {
duplication-strategy: [
"soft-link"
]

# Possible values: file, path
# "file" will compute an md5 hash of the file content.
# "path" will compute an md5 hash of the file path. This strategy will only be effective if the duplication-strategy (above) is set to "soft-link",
# in order to allow for the original file path to be hashed.
hashing-strategy: "path"

# When true, will check if a sibling file with the same name and the .md5 extension exists, and if it does, use the content of this file as a hash.
# If false or the md5 does not exist, will proceed with the above-defined hashing strategy.
check-sibling-md5: false
}
}
}
}
}
}
}

database {
db.url = "jdbc:mysql://mysql-db/cromwell_db?allowPublicKeyRetrieval=true&useSSL=false&rewriteBatchedStatements=true"
db.user = "cromwell"
db.password = "cromwell"
db.driver = "com.mysql.cj.jdbc.Driver"
profile = "slick.jdbc.MySQLProfile$"
db.connectionTimeout = 15000
}
4 changes: 4 additions & 0 deletions scripts/docker-compose-mysql/compose/mysql/init/init_user.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE USER 'cromwell'@'localhost' IDENTIFIED BY 'cromwell';
GRANT ALL PRIVILEGES ON cromwell_db.* TO 'cromwell'@'localhost' WITH GRANT OPTION;
CREATE USER 'cromwell'@'%' IDENTIFIED BY 'cromwell';
GRANT ALL PRIVILEGES ON cromwell_db.* TO 'cromwell'@'%' WITH GRANT OPTION;
22 changes: 22 additions & 0 deletions scripts/docker-compose-mysql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '2'
services:
cromwell:
build:
context: ./compose/cromwell
volumes:
- ./cromwell-executions:/cromwell-working-dir/cromwell-executions
command: ["/wait-for-it/wait-for-it.sh mysql-db:3306 -t 120 -- java -Dconfig.file=/app-config/cromwell-application.conf -jar /app/cromwell.jar server"]
links:
- mysql-db
ports:
- "80:8000"
mysql-db:
image: "mysql:5.7"
environment:
- MYSQL_ROOT_PASSWORD=cromwell
- MYSQL_DATABASE=cromwell_db
volumes:
- ./compose/mysql/init:/docker-entrypoint-initdb.d
- ./compose/mysql/data:/var/lib/mysql
ports:
- "3307:3306"
9 changes: 9 additions & 0 deletions scripts/docker-compose-mysql/jes-cromwell/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2'
services:
cromwell:
volumes:
- $HOME/.config/gcloud:/root/.config/gcloud
- ./jes-cromwell/jes-config:/app-config
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/root/.config/gcloud/application_default_credentials.json

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
include required(classpath("application"))

# Note: If you spot a mistake in this configuration sample, please let us know by making an issue at:
# https://github.com/broadinstitute/cromwell/issues

system.new-workflow-poll-rate=1

google {

application-name = "cromwell"

auths = [
{
name = "application-default"
scheme = "application_default"
}
]
}

engine {
filesystems {
gcs {
auth = "application-default"
}
}
}

call-caching {
enabled = false
}

backend {
default = "Jes"
providers {
Jes {
actor-factory = "cromwell.backend.impl.jes.JesBackendLifecycleActorFactory"
config {
// Google project
project = "broad-dsde-cromwell-dev"

// Base bucket for workflow executions
root = "gs://tjeandet-cromwell-execs"

// Polling for completion backs-off gradually for slower-running jobs.
// This is the maximum polling interval (in seconds):
maximum-polling-interval = 600

genomics {
// A reference to an auth defined in the `google` stanza at the top. This auth is used to create
// Pipelines and manipulate auth JSONs.
auth = "application-default"
// Endpoint for APIs, no reason to change this unless directed by Google.
endpoint-url = "https://genomics.googleapis.com/"
}

filesystems {
gcs {
// A reference to a potentially different auth for manipulating files via engine functions.
auth = "application-default"
}
}
}
}
}
}

database {
db.url = "jdbc:mysql://mysql-db/cromwell_db?useSSL=false&rewriteBatchedStatements=true"
db.user = "cromwell"
db.password = "cromwell"
db.driver = "com.mysql.cj.jdbc.Driver"
profile = "slick.jdbc.MySQLProfile$"
}
Loading

0 comments on commit 3f9ce28

Please sign in to comment.