Skip to content

Commit

Permalink
Merge pull request #22 from scilus/feat/build_date_tags
Browse files Browse the repository at this point in the history
Add build date tags to relevant targets
  • Loading branch information
AlexVCaron authored Dec 20, 2023
2 parents c1d5b84 + 9b55b0f commit a556282
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/docker-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:
required: false
type: boolean
default: false
disable-builddate-tag:
description: disable pushing stamped tag (suffixed with timestamp -YYYYMMDD)
required: false
type: boolean
default: false
scilpy-version:
description: scilpy version (release or branch name)
required: false
Expand All @@ -39,10 +44,6 @@ on:
required: false
type: string
default: latest
nextflow-version:
description: nextflow version (format X.X.X)
required: false
type: string
build-system-ref:
description: github reference of the build system to checkout
required: false
Expand All @@ -60,6 +61,10 @@ on:
required: false
type: boolean
default: false
disable-builddate-tag:
required: false
type: boolean
default: false
scilpy-version:
required: false
type: string
Expand Down Expand Up @@ -167,6 +172,7 @@ jobs:
touch tag-publishing
echo "${{ inputs.target }}.output=type=registry" >> tag-publishing
echo "${{ inputs.target }}.tags=${{ secrets.DOCKER_USERNAME }}/${{ inputs.target }}:${{ inputs.tag }}" >> tag-publishing
[ "${{ inputs.disable-builddate-tag }}" != "true" ] && echo "${{ inputs.target }}.tags=${{ secrets.DOCKER_USERNAME }}/${{ inputs.target }}:${{ inputs.tag }}-$(date +'%Y%m%d')" >> tag-publishing
[ "${{ inputs.update-latest }}" == "true" ] && echo "${{ inputs.target }}.tags=${{ secrets.DOCKER_USERNAME }}/${{ inputs.target }}:latest" >> tag-publishing
DELIM="$(echo $RANDOM | base64 | head -c 3; echo)"
echo "tags-file=$PWD/tag-publishing" >> $GITHUB_OUTPUT
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ is equivalent to
`docker run <scilus-flows image> nextflow run /scilus_flows/tractometry_flow/main.nf <args>`
___

## Singularity
## Singularity / Apptainer

The image for Singularity can be built using `singularity_scilus.def` with the
The image for Singularity / Apptainer can be built using `singularity_scilus.def` with the
command:

`sudo singularity build scilus_${SCILPY_VERSION}.img singularity_scilus.def`.
`sudo apptainer build scilus_${SCILPY_VERSION}.img singularity_scilus.def`.

Singularity container is built from the Docker stored on dockerhub.
The image is built from the Docker stored on dockerhub.

It can be used to run any SCILUS flows with the option
`-with-singularity scilus_${SCILPY_VERSION}.img` of Nextflow.

If you use this singularity, please cite:
If you use this image, please cite:

```
Kurtzer GM, Sochat V, Bauer MW (2017)
Expand Down
21 changes: 12 additions & 9 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ variable "SCILUS_TAG" {
variable "FLOWS_TAG" {
}

# ==============================================================================
# UTILITY FUNCTIONS
# ==============================================================================

function "stamp_tag" {
params = [base_tag, stamp]
result = ["${base_tag}", "${base_tag}-${formatdate("YYYYMMDD", stamp)}"]
}

# ==============================================================================
# DOCKER BUILDX BAKE TARGETS
# ==============================================================================
Expand Down Expand Up @@ -209,9 +218,7 @@ target "scilus-flows" {
NODDIFLOW_VERSION = "${noddi-flow-version}"
BSTFLOW_VERSION = "${bst-flow-version}"
}
tags = [
notequal("", FLOWS_TAG) ? "scilus/scilus-flows:${FLOWS_TAG}" : "scilus-flows:local"
]
tags = notequal("", FLOWS_TAG) ? stamp_tag("scilus/scilus-flows:${FLOWS_TAG}", timestamp()) : ["scilus-flows:local"]
cache-from = [
"type=registry,ref=${dockerhub-user-pull}/build-cache:scilus-flows",
"type=registry,ref=scilus/build-cache:scilus-flows"
Expand Down Expand Up @@ -262,9 +269,7 @@ target "scilus" {
SCILPY_VERSION = "${scilpy-version}"
ITK_NUM_THREADS = "${itk-num-threads}"
}
tags = [
notequal("", SCILUS_TAG) ? "scilus/scilus:${SCILUS_TAG}" : "scilus:local"
]
tags = notequal("", SCILUS_TAG) ? stamp_tag("scilus/scilus:${SCILUS_TAG}", timestamp()) : ["scilus:local"]
output = ["type=docker"]
}

Expand Down Expand Up @@ -299,9 +304,7 @@ target "scilus-fsl" {
"type=registry,ref=${dockerhub-user-pull}/build-cache:scilus-deps",
"type=registry,ref=scilus/build-cache:scilus-deps"
]
tags = [
notequal("", DEPS_TAG) ? "scilus/scilus-deps:${DEPS_TAG}" : ""
]
tags = notequal("", DEPS_TAG) ? stamp_tag("scilus/scilus-deps:${DEPS_TAG}", timestamp()) : []
output = ["type=docker"]
}

Expand Down

0 comments on commit a556282

Please sign in to comment.