Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- '.github/**'
- 'container/**'
- 'outputs/**.sh'
- 'outputs/Makefile'

container:
if: ${{ needs.changes.outputs.container == 'true' || startsWith(github.ref, 'refs/tags/') }}
Expand All @@ -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' }}
10 changes: 7 additions & 3 deletions .github/workflows/outputs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Generate outputs
on:
workflow_call:
inputs:
container_artifact:
required: true
type: boolean

jobs:
re-generate:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ USER spack

WORKDIR /home/spack

ENTRYPOINT [ "bash" ]
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
26 changes: 8 additions & 18 deletions outputs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
Loading