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

Remove broken caching and use workaround for broken pip install #28

Merged
merged 39 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
63e8e04
Add a status badge to the README
christopherwharrop-noaa Jul 20, 2023
a6e86ed
Don't use caching in CI when pushing container images to registry
christopherwharrop-noaa Jul 20, 2023
b88364f
Remove use of docker image cache in push steps
christopherwharrop-noaa Jul 21, 2023
2f4455e
Try cache-from at the beginning and cache-to at the end
christopherwharrop-noaa Jul 21, 2023
eda66e9
Remove checkout action as it's not needed
christopherwharrop-noaa Jul 21, 2023
7706d12
Put checkout action back in
christopherwharrop-noaa Jul 21, 2023
97a8955
Don't push frontend for now
christopherwharrop-noaa Jul 21, 2023
37e8106
Try pulling the caches before trying to use them
christopherwharrop-noaa Jul 21, 2023
aa6324c
Add the missing pieces back in and try again
christopherwharrop-noaa Jul 21, 2023
cba9c8e
Forget about the cache...
christopherwharrop-noaa Aug 11, 2023
d88e618
Back to using cache
christopherwharrop-noaa Aug 11, 2023
540636a
Try using latest as cache
christopherwharrop-noaa Aug 12, 2023
4572644
debug
christopherwharrop-noaa Aug 14, 2023
5f2dee0
debug
christopherwharrop-noaa Aug 14, 2023
7352cbb
debug
christopherwharrop-noaa Aug 14, 2023
1e719f3
Update flux
christopherwharrop-noaa Aug 14, 2023
8199257
Add spack env load in flux app
christopherwharrop-noaa Aug 18, 2023
c16ad60
debug
christopherwharrop-noaa Aug 18, 2023
e18062d
debug
christopherwharrop-noaa Aug 19, 2023
2ece603
debug
christopherwharrop-noaa Aug 19, 2023
1ee07ec
debug
christopherwharrop-noaa Aug 19, 2023
04bbc1f
Debug
christopherwharrop-noaa Aug 19, 2023
fb06be8
debug
christopherwharrop-noaa Aug 19, 2023
edb5c2c
debug
christopherwharrop-noaa Aug 19, 2023
e9174cb
debug
christopherwharrop-noaa Aug 19, 2023
f6a0ab4
debug
christopherwharrop-noaa Aug 19, 2023
2a674d9
debug
christopherwharrop-noaa Aug 19, 2023
73c9b12
debug
christopherwharrop-noaa Aug 19, 2023
276d680
debug
christopherwharrop-noaa Aug 19, 2023
b387245
debug
christopherwharrop-noaa Aug 19, 2023
bf21dc0
Revert back to not using ghcr for caches.
christopherwharrop-noaa Aug 19, 2023
a993a74
Remove cache from compose yaml
christopherwharrop-noaa Aug 19, 2023
ad10ece
Cleanup
christopherwharrop-noaa Aug 19, 2023
fc0b257
add push
christopherwharrop-noaa Aug 19, 2023
65b1306
debug
christopherwharrop-noaa Aug 20, 2023
006a836
debug
christopherwharrop-noaa Aug 20, 2023
47cab6e
debug
christopherwharrop-noaa Aug 20, 2023
4890787
Revert to old compose
christopherwharrop-noaa Aug 20, 2023
ab8d994
Add carriage return at the end
christopherwharrop-noaa Aug 21, 2023
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
88 changes: 17 additions & 71 deletions .github/workflows/docker-slurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,13 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build frontend
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/frontend/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
-
name: Build master
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/master/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
-
name: Build node
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/node/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max
-
name: Start Slurm cluster containers
run: |
cd docker
export DOCKER_CLIENT_TIMEOUT=600
export COMPOSE_HTTP_TIMEOUT=600
docker-compose -f docker-compose.yml up -d --no-build
docker-compose -f docker-compose.yml up --build -d
-
name: Create ssh keys in cluster
run: |
Expand All @@ -73,6 +40,10 @@ jobs:
name: Copy test scripts to work directory
run: |
docker exec frontend bash -l -c "mkdir -p work; cd work ; cp ../test/*.py . ; cp ../test/*.f90 ."
-
name: Fix the flux install # This is a workaround to deal with bugs caused by spack/pip conflicts
run: |
docker exec frontend bash -l -c "spack env activate flux; cd /tmp/install; ./install_flux.sh"
-
name: Parsl hello test
run: |
Expand All @@ -83,14 +54,13 @@ jobs:
docker exec frontend bash -l -c "spack env activate flux; cd work ; ./parsl_mpi_flux_hello.py"
docker exec frontend bash -l -c "cat work/resource_list.txt"
docker exec frontend bash -l -c "cat work/mpi_apps.hello.out"
# Uncomment this step to enable interactive debugging
# -
# name: Debug session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 60
# with:
# limit-access-to-actor: true
-
name: Debug session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
limit-access-to-actor: true
-
name: Shut down Slurm cluster containers
run: |
Expand All @@ -99,32 +69,8 @@ jobs:
export COMPOSE_HTTP_TIMEOUT=600
docker-compose -f docker-compose.yml down
-
name: Push frontend
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/frontend/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
-
name: Push master
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/master/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
-
name: Push node
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/node/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max
name: Push containers
run: |
docker push ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:latest
docker push ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:latest
docker push ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:latest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![ExascaleSandboxTests](https://github.com/NOAA-GSL/ExascaleWorkflowSandbox/actions/workflows/docker-slurm.yml/badge.svg)](https://github.com/NOAA-GSL/ExascaleWorkflowSandbox/actions/workflows/docker-slurm.yml)

```
This repository is a scientific product and is not official communication
of the National Oceanic and Atmospheric Administration, or the United States
Expand Down
14 changes: 11 additions & 3 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ COPY ./install /tmp/install
USER admin
SHELL ["/bin/bash", "-c"]

# Install the Spack workflow environment
# Install the Spack flux environment
RUN . /opt/spack/share/spack/setup-env.sh \
&& cd /tmp/install \
&& ./install_flux.sh

# Install parsl into the flux environment
RUN . /opt/spack/share/spack/setup-env.sh \
&& cd /tmp/install \
&& ./install_base.sh \
&& ./install_flux.sh \
&& ./install_parsl.sh

# Re-install the Spack flux environment to rebuild view after pip install of parsl
NaureenBharwaniNOAA marked this conversation as resolved.
Show resolved Hide resolved
RUN . /opt/spack/share/spack/setup-env.sh \
&& cd /tmp/install \
&& ./install_flux.sh

# Set up user shell init
RUN echo ". /opt/spack/share/spack/setup-env.sh" >> /home/admin/.bash_profile \
&& echo "source /opt/intel/oneapi/setvars.sh" >> /home/admin/.bash_profile \
Expand Down
60 changes: 0 additions & 60 deletions docker/install/install_base.sh

This file was deleted.

15 changes: 2 additions & 13 deletions docker/install/install_flux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,9 @@ spack config add config:install_tree:padded_length:128
spack env create ${SPACK_ENV_NAME} || true
spack env activate ${SPACK_ENV_NAME}

# Install python tools
spack add [email protected]%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-pytest%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-pylint%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-flake8%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-mypy%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-black%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add py-ply%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack add miniconda3%${SPACK_ENV_COMPILER} ${TARGET_ARCH_OPT}
spack install

# Install flux components
spack add flux-core@0.49.0%${SPACK_ENV_COMPILER} ^[email protected] ${TARGET_ARCH_OPT}
spack add flux-sched@0.27.0%${SPACK_ENV_COMPILER} ^[email protected] ${TARGET_ARCH_OPT}
spack add flux-core@0.53.0%${SPACK_ENV_COMPILER} ^[email protected].15 ${TARGET_ARCH_OPT}
spack add flux-sched@0.28.0%${SPACK_ENV_COMPILER} ^[email protected].15 ${TARGET_ARCH_OPT}
NaureenBharwaniNOAA marked this conversation as resolved.
Show resolved Hide resolved
spack concretize -f
spack install --no-checksum

Expand Down
51 changes: 49 additions & 2 deletions docker/install/install_parsl.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
#!/bin/env bash

# These can be customized to suit individual needs
DEFAULT_GCC_VERSION=$(/usr/bin/gcc --version | head -1 | sed -e 's/([^()]*)//g' | awk '{print $2}') # Version of system default gcc
DEFAULT_COMPILER="gcc@${DEFAULT_GCC_VERSION}" # Default system compiler used to build newer gcc

SPACK_ENV_NAME="flux" # Name of spack environment to create
SPACK_ENV_COMPILER="[email protected]" # Compiler to use to build the spack environment
TARGET_ARCH_OPT="target=x86_64" # Compiler architecture build target

################################################################################
# help #
################################################################################
help()
{
# Display help
echo "Installs parsl into flux Spack environment"
echo
echo "Usage: install_parsl.sh"
echo
}

# Get the location of Spack so we can update permissions
if [[ $(which spack 2>/dev/null) ]]; then
SPACK_DIR=$(dirname $(dirname $(which spack)))
else
echo "Cannot find Spack."
echo
echo "Please install Spack and/or source Spack's environment setup script: .../spack/share/setup-env.sh"
echo
exit 1
fi

set -eu

# Configure spack
spack config add concretizer:unify:true
spack config add concretizer:reuse:true
spack config add config:db_lock_timeout:300
spack config add config:install_tree:padded_length:128

# Configure spack environment
spack env create ${SPACK_ENV_NAME} || true
spack env activate ${SPACK_ENV_NAME}

# Re-install pip to update the view and make it reappear in the flux environment
NaureenBharwaniNOAA marked this conversation as resolved.
Show resolved Hide resolved
spack env activate flux
pip install parsl
pip install 'dill @ git+https://github.com/uqfoundation/dill'
spack add py-pip%${SPACK_ENV_COMPILER} ^[email protected] ${TARGET_ARCH_OPT}
spack install

# Install parsl with pip
python -m pip install parsl

exit 0
5 changes: 4 additions & 1 deletion docker/test/parsl_mpi_flux_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
walltime='00:10:00',
launcher=SimpleLauncher(),
worker_init='''
# FluxExecutor ignores worker_init
. /opt/spack/share/spack/setup-env.sh
spack env activate flux
''',
),
)
Expand All @@ -45,6 +46,8 @@
@bash_app
def resource_list():
return '''
. /opt/spack/share/spack/setup-env.sh
spack env activate flux
flux resource list > resource_list.txt
'''

Expand Down