Skip to content

Commit 6458d7f

Browse files
committed
Add some very basic CI
1 parent ea4798d commit 6458d7f

File tree

10 files changed

+183
-214
lines changed

10 files changed

+183
-214
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -19,55 +19,21 @@ jobs:
1919
finalize:
2020
timeout-minutes: 10
2121
needs:
22-
- unit-tests
23-
- example-pull-gcr
22+
- test-htc
2423
# Important: the next line MUST be `if: always()`.
2524
# Do not change that line.
2625
# That line is necessary to make sure that this job runs even if tests fail.
2726
if: always()
2827
runs-on: ubuntu-latest
2928
steps:
3029
- run: |
31-
echo unit-tests: ${{ needs.unit-tests.result }}
32-
echo example-pull-gcr: ${{ needs.example-pull-gcr.result }}
30+
echo test-htc: ${{ needs.test-htc.result }}
3331
- run: exit 1
3432
# The last line must NOT end with ||
3533
# All other lines MUST end with ||
3634
if: |
37-
(needs.unit-tests.result != 'success') ||
38-
(needs.example-pull-gcr.result != 'success')
39-
unit-tests:
40-
runs-on: ubuntu-latest
41-
timeout-minutes: 20
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
version:
46-
- '1.2' # minimum Julia version supported in Project.toml
47-
- '1.6' # previous LTS
48-
- '1.10' # current LTS
49-
- '1' # automatically expands to the latest stable 1.x release of Julia
50-
steps:
51-
- uses: actions/checkout@v4
52-
with:
53-
persist-credentials: false
54-
- uses: julia-actions/setup-julia@v2
55-
with:
56-
version: ${{ matrix.version }}
57-
- uses: julia-actions/julia-runtest@v1
58-
- run: find . -type f -name '*.cov'
59-
# - run: find . -type f -name '*.c ov' -exec cat {} \;
60-
- uses: julia-actions/julia-processcoverage@v1
61-
- uses: codecov/codecov-action@v5
62-
with:
63-
files: lcov.info
64-
token: ${{ secrets.CODECOV_TOKEN }}
65-
# If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
66-
# If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
67-
# If this is not a PR, then DO fail CI if the Codecov upload errors.
68-
fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}
69-
test-slurm:
70-
if: false
35+
(needs.test-htc.result != 'success')
36+
test-htc:
7137
runs-on: ubuntu-latest
7238
timeout-minutes: 20
7339
strategy:
@@ -76,82 +42,47 @@ jobs:
7642
version:
7743
# Please note: You must specify the full Julia version number (major.minor.patch).
7844
# This is because the value here will be directly interpolated into a download URL.
79-
# - '1.2.0' # minimum Julia version supported in Project.toml
45+
- '1.0.5' # minimum Julia version supported in Project.toml
8046
- '1.6.7' # previous LTS
8147
- '1.10.7' # current LTS
8248
- '1.11.2' # currently the latest stable release
8349
steps:
84-
- uses: actions/checkout@v4
85-
with:
86-
persist-credentials: false
87-
- name: Print Docker version
88-
run: |
89-
docker --version
90-
docker version
91-
# This next bit of code is taken from:
92-
# https://github.com/kleinhenz/SlurmClusterManager.jl
93-
# Original author: Joseph Kleinhenz
94-
# License: MIT
95-
- name: Setup Slurm inside Docker
96-
run: |
97-
docker version
98-
docker compose version
99-
docker build --build-arg "JULIA_VERSION=${MATRIX_JULIA_VERSION:?}" -t slurm-cluster-julia -f ci/Dockerfile .
100-
docker compose -f ci/docker-compose.yml up -d
101-
docker ps
102-
env:
103-
MATRIX_JULIA_VERSION: ${{matrix.version}}
104-
- name: Print some information for debugging purposes
105-
run: |
106-
docker exec -t slurmctld pwd
107-
docker exec -t slurmctld ls -la
108-
docker exec -t slurmctld ls -la HTCondorClusterManager
109-
- name: Instantiate package
110-
run: docker exec -t slurmctld julia --project=HTCondorClusterManager -e 'import Pkg; @show Base.active_project(); Pkg.instantiate(); Pkg.status()'
111-
- name: Run tests without a Slurm allocation
112-
run: docker exec -t slurmctld julia --project=HTCondorClusterManager -e 'import Pkg; Pkg.test(; test_args=["slurm"])'
113-
- name: Run tests inside salloc
114-
run: docker exec -t slurmctld salloc -t 00:10:00 -n 2 julia --project=HTCondorClusterManager -e 'import Pkg; Pkg.test(; test_args=["slurm"], coverage=true)'
115-
- name: Run tests inside sbatch
116-
run: docker exec -t slurmctld HTCondorClusterManager/ci/run_my_sbatch.sh
117-
- run: find . -type f -name '*.cov'
118-
- name: Copy .cov files out of the Docker container
119-
run: docker exec slurmctld /bin/bash -c 'cd /home/docker/HTCondorClusterManager && tar -cf - src/*.cov' | tar -xvf -
120-
- run: find . -type f -name '*.cov'
121-
# - run: find . -type f -name '*.cov' -exec cat {} \;
122-
- uses: julia-actions/julia-processcoverage@v1
123-
- uses: codecov/codecov-action@v5
124-
with:
125-
files: lcov.info
126-
token: ${{ secrets.CODECOV_TOKEN }}
127-
# If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
128-
# If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
129-
# If this is not a PR, then DO fail CI if the Codecov upload errors.
130-
fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}
131-
example-pull-gcr:
132-
runs-on: ubuntu-latest
133-
timeout-minutes: 20
134-
steps:
135-
- uses: actions/checkout@v4
136-
with:
137-
persist-credentials: false
138-
- name: Print Docker version
139-
run: |
140-
docker --version
141-
docker version
142-
# - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
143-
# if: false
144-
# with:
145-
# registry: ghcr.io
146-
# username: ${{ github.actor }}
147-
# password: ${{ secrets.GITHUB_TOKEN }}
148-
- name: Docker pull
149-
run: |
150-
docker pull "ghcr.io/${MY_GCR_NAMESPACE:?}/${MY_GCR_IMAGENAME:?}@${MY_DIGEST_HTCONDOR_EXECUTE:?}"
151-
env:
152-
# We intentionally pull by full-length digest (NOT tag) for reproducibility:
153-
MY_DIGEST_HTCONDOR_EXECUTE: 'sha256:d4384c19cdb2f26bae15b1feef3a12bde66554658562df2626c03ae870003555' # htcondor-execute
154-
- name: List images
155-
run: |
156-
docker ps -a
157-
docker images
50+
- uses: actions/checkout@v4
51+
with:
52+
persist-credentials: false
53+
- uses: julia-actions/setup-julia@v2
54+
with:
55+
version: ${{ matrix.version }}
56+
- run: docker version
57+
- run: docker compose version
58+
- run: docker compose pull
59+
working-directory: ci/htcondor
60+
- run: docker compose build --build-arg JULIA_VERSION="${MATRIX_VERSION:?}"
61+
working-directory: ci/htcondor
62+
env:
63+
MATRIX_VERSION: ${{matrix.version}}
64+
- run: ./start-htcondor.sh
65+
working-directory: ci/htcondor
66+
- run: docker compose exec -T --user submituser submit condor_submit --help
67+
working-directory: ci/htcondor
68+
- run: docker compose exec -T --user submituser submit julia --version
69+
working-directory: ci/htcondor
70+
- run: docker compose exec -T --user submituser submit julia --project=/SlurmClusterManager -e 'import Pkg; Pkg.test()'
71+
working-directory: ci/htcondor
72+
- run: find . -type f -name '*.cov'
73+
- name: Copy .cov files out of the Docker container
74+
run: |
75+
# docker compose exec -T --user submituser submit /bin/bash -c 'cd ~/HTCondorClusterManager && tar -cf - src/*.cov' | tar -xvf -
76+
docker compose exec -T --user submituser execute1 /bin/bash -c 'cd ~/HTCondorClusterManager && tar -cf - src/*.cov' | tar -xvf -
77+
# docker compose exec -T --user submituser execute2 /bin/bash -c 'cd ~/HTCondorClusterManager && tar -cf - src/*.cov' | tar -xvf -
78+
- run: find . -type f -name '*.cov'
79+
# - run: find . -type f -name '*.cov' -exec cat {} \;
80+
- uses: julia-actions/julia-processcoverage@v1
81+
- uses: codecov/codecov-action@v5
82+
with:
83+
files: lcov.info
84+
token: ${{ secrets.CODECOV_TOKEN }}
85+
# If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
86+
# If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
87+
# If this is not a PR, then DO fail CI if the Codecov upload errors.
88+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}

ci/Dockerfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

ci/docker-compose.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

ci/htcondor/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# We intentionally use full-length digests (NOT tags) for reproducibility.
2+
# FROM ghcr.io/juliaparallel/dask-jobqueue-ci-images:htcondor-submit as submit
3+
FROM ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5ada6445b5d8b53b6693ab86be364dd1ce385ada8e53763731ba50d145f0350d as submit
4+
5+
# We intentionally have no default value:
6+
ARG JULIA_VERSION
7+
8+
RUN mkdir -p /home/docker/.local/opt/julia \
9+
&& cd /home/docker/.local/opt/julia \
10+
&& folder="$(echo 1.11.2 | cut -d. -f1-2)" \
11+
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.2-linux-x86_64.tar.gz | tar xz --strip 1 \
12+
&& /home/docker/.local/opt/julia/bin/julia --version
13+
14+
ENV PATH="/home/docker/.local/opt/julia/bin:${PATH}"
15+
16+
RUN bash -c "pwd"
17+
18+
COPY --chown=docker . SlurmClusterManager
19+
RUN chmod -R u+rw,g+rw,o+rw SlurmClusterManager
20+
21+
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]
22+
23+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24+
25+
# We intentionally use full-length digests (NOT tags) for reproducibility.
26+
# FROM ghcr.io/juliaparallel/dask-jobqueue-ci-images:htcondor-execute as execute
27+
FROM ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5723d0380f627779bc54a31ebac9a77f0937189453f597845411257dea6ac0db as execute
28+
29+
# We intentionally have no default value:
30+
ARG JULIA_VERSION
31+
32+
RUN mkdir -p /home/docker/.local/opt/julia \
33+
&& cd /home/docker/.local/opt/julia \
34+
&& folder="$(echo 1.11.2 | cut -d. -f1-2)" \
35+
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.2-linux-x86_64.tar.gz | tar xz --strip 1 \
36+
&& /home/docker/.local/opt/julia/bin/julia --version
37+
38+
ENV PATH="/home/docker/.local/opt/julia/bin:${PATH}"
39+
40+
RUN bash -c "pwd"
41+
42+
COPY --chown=docker . SlurmClusterManager
43+
RUN chmod -R u+rw,g+rw,o+rw SlurmClusterManager

ci/htcondor/docker-compose.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# This file is based on:
2+
# https://github.com/dask/dask-jobqueue/blob/main/ci/htcondor/docker-compose.yml
3+
# License: BSD 3-Clause
4+
5+
# version: "3.4"
6+
7+
services:
8+
cm:
9+
# We intentionally use full-length digests (NOT tags) for reproducibility.
10+
#
11+
# TODO: mirror this images in our own GCR, instead of needing it to exist in Docker Hub.
12+
# image: htcondor/cm:el7
13+
image: htcondor/cm@sha256:71cfed5ffc1dc78cb725f571e6be6acdb50ca0322c9cc9cd500a965be7e402c6
14+
hostname: cm.htcondor
15+
environment:
16+
- USE_POOL_PASSWORD=yes
17+
volumes:
18+
- secrets:/root/secrets
19+
- ./condor_config.local:/etc/condor/condor_config.local
20+
command: bash -c 'condor_store_cred -p password -f /root/secrets/pool_password ; exec bash -x /start.sh'
21+
22+
submit:
23+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5ada6445b5d8b53b6693ab86be364dd1ce385ada8e53763731ba50d145f0350d
24+
build:
25+
context: ../..
26+
dockerfile: ci/htcondor/Dockerfile
27+
target: submit
28+
hostname: submit.htcondor
29+
environment:
30+
- CONDOR_HOST=cm
31+
- USE_POOL_PASSWORD=yes
32+
- CI_SHARED_SPACE=/shared_space
33+
depends_on:
34+
- cm
35+
volumes:
36+
- secrets:/root/secrets
37+
- ../..:/dask-jobqueue
38+
- ./condor_config.local:/etc/condor/condor_config.local
39+
- shared_space:/shared_space
40+
41+
execute1:
42+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5723d0380f627779bc54a31ebac9a77f0937189453f597845411257dea6ac0db
43+
build:
44+
context: ../..
45+
dockerfile: ci/htcondor/Dockerfile
46+
target: execute
47+
hostname: execute1.htcondor
48+
environment:
49+
- CONDOR_HOST=cm
50+
- USE_POOL_PASSWORD=yes
51+
depends_on:
52+
- cm
53+
volumes:
54+
- secrets:/root/secrets
55+
- ./condor_config.local:/etc/condor/condor_config.local
56+
- shared_space:/shared_space
57+
58+
execute2:
59+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5723d0380f627779bc54a31ebac9a77f0937189453f597845411257dea6ac0db
60+
build:
61+
context: ../..
62+
dockerfile: ci/htcondor/Dockerfile
63+
target: execute
64+
hostname: execute2.htcondor
65+
environment:
66+
- CONDOR_HOST=cm
67+
- USE_POOL_PASSWORD=yes
68+
depends_on:
69+
- cm
70+
volumes:
71+
- secrets:/root/secrets
72+
- ./condor_config.local:/etc/condor/condor_config.local
73+
- shared_space:/shared_space
74+
75+
volumes:
76+
secrets:
77+
shared_space:

ci/htcondor/start-htcondor.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# This file is based on:
4+
# https://github.com/dask/dask-jobqueue/blob/main/ci/htcondor/docker-compose.yml
5+
# License: BSD 3-Clause
6+
7+
docker compose up -d --no-build
8+
9+
while [ `docker compose exec -T submit condor_status -af activity|grep Idle|wc -l` -ne 2 ]
10+
do
11+
echo "Waiting for cluster to become ready";
12+
sleep 2
13+
done
14+
echo "HTCondor properly configured"

0 commit comments

Comments
 (0)