diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3ce6ed6e..e3211ff3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: - '.github/**' - 'container/**' - 'outputs/**.sh' + - 'outputs/Makefile' container: if: ${{ needs.changes.outputs.container == 'true' || startsWith(github.ref, 'refs/tags/') }} @@ -56,3 +57,5 @@ jobs: || startsWith(github.ref, 'refs/tags/')) needs: [ changes, container ] uses: ./.github/workflows/outputs.yml + with: + container_artifact: ${{ needs.changes.outputs.container == 'true' }} diff --git a/.github/workflows/outputs.yml b/.github/workflows/outputs.yml index 3552c5d32..8eceed91f 100644 --- a/.github/workflows/outputs.yml +++ b/.github/workflows/outputs.yml @@ -1,6 +1,10 @@ name: Generate outputs on: workflow_call: + inputs: + container_artifact: + required: true + type: boolean jobs: re-generate: @@ -39,15 +43,15 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Download container from artifact if PR - if: github.event_name == 'pull_request' && needs.container.result == 'success' + - name: Download container if was previously created + if: github.event_name == 'pull_request' && inputs.container_artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: name: tutorial-container path: /tmp - name: Import container from PR artifact - if: github.event_name == 'pull_request' && needs.container.result == 'success' + if: github.event_name == 'pull_request' && inputs.container_artifact run: | docker load --input /tmp/tutorial-container.tar docker image ls -a diff --git a/container/Dockerfile b/container/Dockerfile index ce8cb7433..213b93c0c 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -32,4 +32,4 @@ USER spack WORKDIR /home/spack -ENTRYPOINT [ "bash" ] +ENTRYPOINT [ "/bin/bash", "-l", "-c" ] diff --git a/outputs/Makefile b/outputs/Makefile index 0788a78ff..2e2ad4420 100644 --- a/outputs/Makefile +++ b/outputs/Makefile @@ -14,7 +14,7 @@ DOCKER_RUN_OPTS := # Name of the container we'll generate the tutorial outputs with -container := ghcr.io/spack/tutorial:latest@sha256:417900cce4592159456050a91d844fc9e81fcb01125a55555092fa450ce59a67 +container := ghcr.io/spack/tutorial:latest # Sections to build sections := environments @@ -25,44 +25,34 @@ sections := environments run_targets := $(addprefix run-,$(sections)) # Entrypoint -update-outputs: #run +update-outputs: run echo "Filtering raw outputs though col" for raw in raw/*/*.out; do \ out=$$(echo $$raw | sed 's.raw/..'); \ cat $$raw | perl -pe 's/\x1b]0;.+?\x07//g' | perl -pe 's/\x1b\[\d+F\x1b\[J//g' | perl -pe 's/\033\[([01];)?\d+m//g' | col -bp | sed '/^==> Waiting for/d' > $$out; \ done -run: run-scripting - -run-scripting: run-cache scripting.sh -run-cache: run-dev cache.sh -run-dev: run-packaging dev.sh -run-packaging: run-stacks packaging.sh -run-stacks: run-environments stacks.sh -run-environments: run-basics environments.sh -run-basics: basics.sh init_spack.sh defs.sh - local: local-scripting -local-scripting: local-cache scripting.sh -local-cache: local-dev cache.sh +local-scripting: local-dev scripting.sh +#local-cache: local-dev cache.sh local-dev: local-packaging dev.sh local-packaging: local-stacks packaging.sh local-stacks: local-environments stacks.sh +# local-config: local-environments config.sh # coming soon^TM local-environments: local-basics environments.sh local-basics: basics.sh init_spack.sh defs.sh local-%: %.sh init_spack.sh defs.sh $(CURDIR)/$(@:local-%=%).sh -run-%: %.sh init_spack.sh defs.sh +run: $(DOCKER) run $(DOCKER_RUN_OPTS) --rm -t \ - --mount type=bind,source=$(CURDIR),target=/project \ - ${container} \ - /project/$(@:run-%=%).sh && touch $@ + --mount type=bind,source=$(CURDIR),target=/project -w /project \ + ${container} "make local" interactive: $(DOCKER) run $(DOCKER_RUN_OPTS) --rm -it \ - --mount type=bind,source=$(CURDIR),target=/project \ + --mount type=bind,source=$(CURDIR),target=/project -w /project \ ${container} $(addprefix clean-,$(sections)):