diff --git a/doc/howto/configuration.md b/doc/howto/configuration.md index ae946952..e53db294 100644 --- a/doc/howto/configuration.md +++ b/doc/howto/configuration.md @@ -33,6 +33,7 @@ An example manifest entry may look like "lifecycle-pre-stop": ["su", "-c", "cd /data; for f in *; do fusermount -u $f; rm -rf $f; done", "-s", "/bin/sh", "jovyan"] }, "nextflow-global": { + "sample-config-public-image": "", "imagebuilder-reader-role-arn": "" }, "containers": [ @@ -125,6 +126,7 @@ An example manifest entry may look like * `command` a string array as the command to run in the container overriding the default. * `lifecycle-pre-stop` a string array as the container prestop command. * `nextflow-global` is for global configuration specific to Nextflow containers. + * `sample-config-public-image`: a publicly-accessible image that any user can pull to test Nextflow workflows. Will be mentioned in the auto-generated sample configuration and documentation when a user launches a Nextflow workspace. * `imagebuilder-reader-role-arn`: see the [nextflow-global.imagebuilder-reader-role-arn section](/doc/explanation/nextflow.md#nextflow-globalimagebuilder-reader-role-arn) of the Nextflow workspaces documentation. * `containers` is the list of workspaces available to be run by this instance of Hatchery. Each container must be a single image and expose a web server. * `target-port` specifies the port that the container is exposing the webserver on. diff --git a/hatchery/config.go b/hatchery/config.go index 0d64c08f..25e5a626 100644 --- a/hatchery/config.go +++ b/hatchery/config.go @@ -14,6 +14,7 @@ import ( // Global configuration shared by all Nextflow containers type NextflowGlobalConfig struct { + SampleConfigPublicImage string `json:"sample-config-public-image"` ImageBuilderReaderRoleArn string `json:"imagebuilder-reader-role-arn"` } diff --git a/hatchery/hatchery.go b/hatchery/hatchery.go index 5ca51bfd..641b5d00 100644 --- a/hatchery/hatchery.go +++ b/hatchery/hatchery.go @@ -700,7 +700,7 @@ func getMountFileContents(fileId string, userName string) (string, error) { } if fileId == "sample-nextflow-config.txt" { - out, err := generateNextflowConfig(userName) + out, err := generateNextflowConfig(Config.Config.NextflowGlobalConfig, userName) if err != nil { Config.Logger.Printf("unable to generate Nextflow config: %v", err) } diff --git a/hatchery/hatchery_test.go b/hatchery/hatchery_test.go index 0dd9cff1..426ea1f4 100644 --- a/hatchery/hatchery_test.go +++ b/hatchery/hatchery_test.go @@ -1065,7 +1065,7 @@ aws { } }` originalGenerateNextflowConfig := generateNextflowConfig - generateNextflowConfig = func(userName string) (string, error) { + generateNextflowConfig = func(nextflowGlobalConfig NextflowGlobalConfig, userName string) (string, error) { return fileContents, nil } defer func() { diff --git a/hatchery/nextflow.go b/hatchery/nextflow.go index fe4939de..c048fa64 100644 --- a/hatchery/nextflow.go +++ b/hatchery/nextflow.go @@ -1608,7 +1608,7 @@ var stopSquidInstance = func(hostname string, userName string, ec2svc *ec2.EC2) return nil } -var generateNextflowConfig = func(userName string) (string, error) { +var generateNextflowConfig = func(nextflowGlobalConfig NextflowGlobalConfig, userName string) (string, error) { sess := session.Must(session.NewSession(&aws.Config{ Region: aws.String("us-east-1"), })) @@ -1652,7 +1652,7 @@ var generateNextflowConfig = func(userName string) (string, error) { process { executor = 'awsbatch' queue = '%s' - container = 'public.ecr.aws/l5b8a5z6/nextflow-approved/public:gen3-amazonlinux-base-AL2023fix' + container = '%s' } aws { batch { @@ -1662,6 +1662,7 @@ aws { } workDir = '%s'`, batchJobQueueName, + nextflowGlobalConfig.SampleConfigPublicImage, nextflowJobsRoleArn, workDir, )