Skip to content

Commit bb0817b

Browse files
committed
ci: enable output generation for tutorial
Signed-off-by: Alec Scott <scott112@llnl.gov>
1 parent a4406d3 commit bb0817b

5 files changed

Lines changed: 22 additions & 46 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ jobs:
5050
needs: changes
5151
uses: ./.github/workflows/container.yml
5252

53-
# outputs:
54-
# if: |
55-
# !cancelled()
56-
# && contains(needs.*.result, 'success')
57-
# && !contains(needs.*.result, 'failure')
58-
# && (needs.changes.outputs.outputs == 'true'
59-
# || startsWith(github.ref, 'refs/tags/'))
60-
# needs: [ changes, container ]
61-
# uses: ./.github/workflows/outputs.yml
53+
outputs:
54+
if: |
55+
!cancelled()
56+
&& contains(needs.*.result, 'success')
57+
&& !contains(needs.*.result, 'failure')
58+
&& (needs.changes.outputs.outputs == 'true'
59+
|| startsWith(github.ref, 'refs/tags/'))
60+
needs: [ changes, container ]
61+
uses: ./.github/workflows/outputs.yml
62+
with:
63+
with_pr_container: ${{ needs.container.result == 'success' }}
6264

6365
style:
6466
if: ${{ needs.changes.outputs.style == 'true' }}

.github/workflows/container.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@ jobs:
1010
packages: write
1111

1212
steps:
13-
- name: Remove pre-installed apps to make space for build
14-
run: |
15-
sudo apt-get remove -y '^llvm-.*'
16-
sudo apt-get remove -y '^dotnet-.*'
17-
sudo apt-get remove -y 'php.*'
18-
sudo apt-get remove -y '^mongodb-.*'
19-
sudo apt-get remove -y '^mysql-.*'
20-
sudo apt-get autoremove -y
21-
sudo apt-get clean
22-
sudo rm -rf /usr/share/dotnet/
23-
sudo rm -rf /usr/local/share/powershell
24-
sudo rm -rf /usr/local/share/chromium
25-
sudo rm -rf /usr/local/lib/android
26-
sudo rm -rf /usr/local/lib/node_modules
27-
2813
- name: Set up QEMU
2914
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
3015

.github/workflows/outputs.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Generate outputs
22
on:
33
workflow_call:
4+
inputs:
5+
with_pr_container:
6+
required: true
7+
type: boolean
48

59
jobs:
610
re-generate:
@@ -10,22 +14,6 @@ jobs:
1014
contents: write
1115

1216
steps:
13-
- name: Remove pre-installed apps to make space for build
14-
run: |
15-
sudo apt-get remove -y '^llvm-.*'
16-
sudo apt-get remove -y '^dotnet-.*'
17-
sudo apt-get remove -y 'php.*'
18-
sudo apt-get remove -y '^mongodb-.*'
19-
sudo apt-get remove -y '^mysql-.*'
20-
sudo apt-get autoremove -y
21-
sudo apt-get clean
22-
sudo rm -rf /usr/share/dotnet/
23-
sudo rm -rf /usr/local/share/powershell
24-
sudo rm -rf /usr/local/share/chromium
25-
sudo rm -rf /usr/local/lib/android
26-
sudo rm -rf /usr/local/lib/node_modules
27-
sudo docker system prune -af
28-
2917
- name: Checkout (Push)
3018
if: github.event_name != 'pull_request'
3119
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
@@ -40,14 +28,14 @@ jobs:
4028
repository: ${{ github.event.pull_request.head.repo.full_name }}
4129

4230
- name: Download container from artifact if PR
43-
if: github.event_name == 'pull_request' && needs.container.result == 'success'
31+
if: github.event_name == 'pull_request' && inputs.with_pr_container
4432
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
4533
with:
4634
name: tutorial-container
4735
path: /tmp
4836

4937
- name: Import container from PR artifact
50-
if: github.event_name == 'pull_request' && needs.container.result == 'success'
38+
if: github.event_name == 'pull_request' && inputs.with_pr_container
5139
run: |
5240
docker load --input /tmp/tutorial-container.tar
5341
docker image ls -a

container/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ ENV DEBIAN_FRONTEND=noninteractive
55
# Install AWS cli
66
RUN apt-get update -y && \
77
apt-get install -y --no-install-recommends \
8-
awscli \
98
bash-completion \
9+
ca-certificates \
1010
emacs \
1111
jq \
1212
less \
13-
vim
13+
vim \
14+
rclone
1415

1516
# Remove GCC 12 from container
1617
RUN apt-get remove -y gcc-12
1718

1819
# Download the buildcache
1920
RUN mkdir /mirror
20-
RUN aws --region us-east-1 --no-sign-request s3 sync --only-show-errors s3://spack-binaries/releases/v0.23/tutorial /mirror
21+
RUN rclone copy :s3:spack-binaries/v0.23.1/tutorial /mirror
2122

2223
RUN chmod -R go+r /mirror
2324

outputs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sections := environments
2525
run_targets := $(addprefix run-,$(sections))
2626

2727
# Entrypoint
28-
update-outputs: #run
28+
update-outputs: run
2929
echo "Filtering raw outputs though col"
3030
for raw in raw/*/*.out; do \
3131
out=$$(echo $$raw | sed 's.raw/..'); \

0 commit comments

Comments
 (0)