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

Proposal: Zenodo release: Release source code of containers #3157

Open
blechta opened this issue Oct 12, 2023 · 0 comments
Open

Proposal: Zenodo release: Release source code of containers #3157

blechta opened this issue Oct 12, 2023 · 0 comments

Comments

@blechta
Copy link
Contributor

blechta commented Oct 12, 2023

With the following script, any (every?) tag can be released. This could be done automatically and could lower overall number of release requests as users might tend to just reuse the existing release.

#!/bin/bash
set -e

# Select image
IMAGE="firedrakeproject/firedrake:2023-10"

# Compose Docker command to be run on the host
DOCKER_RUN_CMD=(
    docker
    run
    --rm
    ${IMAGE}
    /bin/bash
    -c
)

# Compose commands to be run in the container
read -r -d '' CONTAINER_CMD <<EOF || true
set -e

# Activate Firedrake virtualenv
source ~/firedrake/bin/activate

# Symlink PETSc and SLEPc to expected location
ln -s /home/firedrake/petsc /home/firedrake/firedrake/src/
ln -s /home/firedrake/slepc /home/firedrake/firedrake/src/
ln -s /home/firedrake/firedrake/src/petsc/src/binding/petsc4py /home/firedrake/firedrake/src/
ln -s /home/firedrake/firedrake/src/slepc/src/binding/slepc4py /home/firedrake/firedrake/src/

# Recover deleted .out files
cd /home/firedrake/firedrake/src/petsc
git reset --hard

components=(firedrake PyOP2 tsfc ufl FInAT fiat petsc petsc4py loopy slepc slepc4py)
for comp in "\${components[@]}"; do
    cd /home/firedrake/firedrake/src/\${comp}
    # Fix stale stat cache: https://stackoverflow.com/a/36439778
    git update-index --refresh
done

# Release
cd /tmp
firedrake-zenodo -t "Release of source codes for Docker image ${IMAGE}"
cat firedrake.json
EOF

# Run actual commands
"${DOCKER_RUN_CMD[@]}" "${CONTAINER_CMD}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant