Skip to content

Commit 1368f16

Browse files
authored
Merge pull request #120 from dakotablair/actions
Add end to end test github actions.
2 parents 2c5fe62 + 40ad758 commit 1368f16

File tree

5 files changed

+255
-0
lines changed

5 files changed

+255
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build and push chimbuko-spack-dev-ddb image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Check out this repo
18+
uses: actions/checkout@v5
19+
with:
20+
path: 'ChimbukoVisualizationII'
21+
ref: 'actions_unstable'
22+
23+
- name: Check out the PerformanceAnalysis repo
24+
uses: actions/checkout@v5
25+
with:
26+
path: 'PerformanceAnalysis'
27+
ref: 'ckelly_develop_ddb'
28+
repository: 'CODARcode/PerformanceAnalysis'
29+
30+
- name: Login to GHCR
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
# note that the calling workflow must set `secrets: inherit`
35+
username: '${{ github.actor }}'
36+
password: '${{ secrets.GITHUB_TOKEN }}'
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Pull chimbuko/chimbuko-spack-env docker image
45+
shell: bash
46+
run: |
47+
docker pull ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-env:ubuntu18.04
48+
docker image tag \
49+
ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-env:ubuntu18.04 \
50+
chimbuko/chimbuko-spack-env:ubuntu18.04
51+
52+
- name: Build test environment image
53+
shell: bash
54+
run: |
55+
cd PerformanceAnalysis/
56+
docker build \
57+
-f docker/ubuntu18.04/openmpi4.0.4/all_spack/Dockerfile.cv2 \
58+
-t chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04 \
59+
.
60+
61+
- name: Push chimbuko-spack-dev-ddb image
62+
shell: bash
63+
run: |
64+
docker image tag chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04 \
65+
ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04
66+
docker image push ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build and push chimbuko-spack-env image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Check out this repo
18+
uses: actions/checkout@v5
19+
with:
20+
path: 'ChimbukoVisualizationII'
21+
ref: 'actions'
22+
23+
- name: Check out the PerformanceAnalysis repo
24+
uses: actions/checkout@v5
25+
with:
26+
path: 'PerformanceAnalysis'
27+
ref: 'ckelly_develop'
28+
repository: 'CODARcode/PerformanceAnalysis'
29+
30+
- name: Login to GHCR
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
# note that the calling workflow must set `secrets: inherit`
35+
username: '${{ github.actor }}'
36+
password: '${{ secrets.GITHUB_TOKEN }}'
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Build PerformanceAnalysis image
45+
shell: bash
46+
run: |
47+
cd PerformanceAnalysis/docker/ubuntu18.04/openmpi4.0.4/all_spack
48+
docker build \
49+
-f Dockerfile.spack_env \
50+
-t chimbuko/chimbuko-spack-env:ubuntu18.04 \
51+
.
52+
53+
- name: Push PerformanceAnalysis image
54+
shell: bash
55+
run: |
56+
docker image tag chimbuko/chimbuko-spack-env:ubuntu18.04 \
57+
ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-env:ubuntu18.04
58+
docker image push ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-env:ubuntu18.04

.github/workflows/end-to-end.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Chimbuko Visualization II End-to-end Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
end_to_end_tests:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
# Check out ChimubkoVisualizationII (CV2) repo.
18+
- name: Check out the CV2 repo
19+
uses: actions/checkout@v4
20+
with:
21+
ref: 'actions_unstable'
22+
23+
- name: Check out the PerformanceAnalysis repo
24+
uses: actions/checkout@v4
25+
with:
26+
path: 'PerformanceAnalysis'
27+
ref: 'ckelly_develop'
28+
repository: 'CODARcode/PerformanceAnalysis'
29+
30+
- name: Pull chimbuko/chimbuko-spack-dev-ddb docker image
31+
shell: bash
32+
run: |
33+
docker pull ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04
34+
docker image tag \
35+
ghcr.io/${{ github.repository_owner }}/chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04 \
36+
chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04
37+
38+
- name: Run tests in container
39+
shell: bash
40+
run: |
41+
docker run --rm \
42+
--privileged \
43+
--entrypoint /bin/bash \
44+
--env NGROK_TOKEN=${{ secrets.NGROK_TOKEN }} \
45+
--env RUN_DIR=$(pwd) \
46+
--publish 5002:5002 \
47+
--volume $(pwd):$(pwd) \
48+
chimbuko/chimbuko-spack-dev-ddb:ubuntu18.04 \
49+
-c "$(pwd)/docker/e2e-test.sh"
50+
51+

docker/e2e-test.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
set -eux pipefail
4+
5+
env
6+
7+
ls -halF $RUN_DIR
8+
9+
pushd $RUN_DIR
10+
git config --global --add safe.directory $RUN_DIR
11+
git checkout actions_unstable
12+
13+
mkdir -p data/grid
14+
ln -s /Downloads/repeat_1rank data/grid/
15+
16+
# Install Redis
17+
18+
./webserver/run-redis.sh &
19+
20+
pushd /opt/spack-environment/ && \
21+
source /spack/spack/share/spack/setup-env.sh && \
22+
spack env activate .
23+
popd
24+
25+
python -m pip install -r requirements.large.txt
26+
python -m pip install -r requirements.txt
27+
28+
REDIS_CLI="./redis-stable/src/redis-cli"
29+
function hold_for_redis () {
30+
while [[ ! -x $REDIS_CLI ]]; do
31+
echo wait for redis-cli: hold on 10 s
32+
sleep 10
33+
done
34+
OUTPUT="";
35+
while [[ "$OUTPUT" != "PONG" ]]; do
36+
OUTPUT=`$REDIS_CLI PING`;
37+
echo wait for redis: hold on 1 sec
38+
sleep 1
39+
done
40+
}
41+
42+
set +e
43+
44+
hold_for_redis
45+
46+
set -e
47+
48+
# Fix configuration
49+
CONF="./redis-stable/redis.conf"
50+
sed -i '422s/^/# /' $CONF
51+
sed -i '2017s/^/# /' $CONF
52+
sed -i '2018s/^/# /' $CONF
53+
sed -i "s/^protected-mode yes/protected-mode no/" $CONF
54+
sed -i "s/^bind 127.0.0.1/bind 0.0.0.0/" $CONF
55+
sed -i "s/^daemonize no/daemonize yes/" $CONF
56+
sed -i "s|^dir ./|dir $RUN_DIR/|" $CONF
57+
sed -i "s|^pidfile /var/run/redis_6379.pid|pidfile $RUN_DIR/redis.pid|" $CONF
58+
killall -r '.*redis.*'
59+
60+
popd
61+
62+
# Install ngrok
63+
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
64+
| tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
65+
&& echo "deb https://ngrok-agent.s3.amazonaws.com bookworm main" \
66+
| tee /etc/apt/sources.list.d/ngrok.list \
67+
&& apt update \
68+
&& apt install -y ngrok
69+
ngrok config add-authtoken $NGROK_TOKEN
70+
71+
RUN_SCRIPT="./run.sh"
72+
sed -i "s/^cycles=200/cycles=100/" $RUN_SCRIPT
73+
sed -i "s/mpirun/mpirun --oversubscribe/" $RUN_SCRIPT
74+
75+
ngrok http 5002 &
76+
77+
CHIMBUKO_VIZ_ROOT=$RUN_DIR $RUN_SCRIPT
78+
79+
set +ex

server/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def get_inspect():
8080
if 'pdb' in globals():
8181
del pdb
8282
print("Shutting down provdb!")
83+
return jsonify({})
8384

8485

8586
@main.route('/')

0 commit comments

Comments
 (0)