Skip to content

Commit ee59348

Browse files
committed
Add some very basic CI
1 parent 743113c commit ee59348

File tree

3 files changed

+171
-69
lines changed

3 files changed

+171
-69
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
finalize:
2020
timeout-minutes: 10
2121
needs:
22-
- unit-tests
22+
- test-htc
2323
- example-pull-gcr
2424
# Important: the next line MUST be `if: always()`.
2525
# Do not change that line.
@@ -28,44 +28,52 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- run: |
31-
echo unit-tests: ${{ needs.unit-tests.result }}
31+
echo test-htc: ${{ needs.test-htc.result }}
3232
echo example-pull-gcr: ${{ needs.example-pull-gcr.result }}
3333
- run: exit 1
3434
# The last line must NOT end with ||
3535
# All other lines MUST end with ||
3636
if: |
37-
(needs.unit-tests.result != 'success') ||
37+
(needs.test-htc.result != 'success') ||
3838
(needs.example-pull-gcr.result != 'success')
39-
unit-tests:
39+
test-htc:
4040
runs-on: ubuntu-latest
4141
timeout-minutes: 20
4242
strategy:
4343
fail-fast: false
4444
matrix:
4545
version:
46-
- '1.2' # minimum Julia version supported in Project.toml
47-
- '1.6' # previous LTS
46+
# - '1.2' # minimum Julia version supported in Project.toml
47+
# - '1.6' # previous LTS
4848
- '1.10' # current LTS
4949
- '1' # automatically expands to the latest stable 1.x release of Julia
5050
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'
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+
- run: docker version
58+
- run: docker compose version
59+
- run: docker compose pull
60+
working-directory: ci/htcondor
61+
- run: ./start-htcondor.sh
62+
working-directory: ci/htcondor
63+
- run: docker compose exec -T --user submituser submit /bin/bash -c "set -euf -o pipefail; set -x; which -a condor_submit; condor_submit --version; condor_submit --help"
64+
working-directory: ci/htcondor
65+
- uses: julia-actions/julia-runtest@v1
66+
# - run: find . -type f -name '*.cov'
5967
# - 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 }}
68+
# - uses: julia-actions/julia-processcoverage@v1
69+
# - uses: codecov/codecov-action@v5
70+
# with:
71+
# files: lcov.info
72+
# token: ${{ secrets.CODECOV_TOKEN }}
73+
# # If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
74+
# # If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
75+
# # If this is not a PR, then DO fail CI if the Codecov upload errors.
76+
# fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}
6977
test-slurm:
7078
if: false
7179
runs-on: ubuntu-latest
@@ -81,53 +89,53 @@ jobs:
8189
- '1.10.7' # current LTS
8290
- '1.11.2' # currently the latest stable release
8391
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'
92+
- uses: actions/checkout@v4
93+
with:
94+
persist-credentials: false
95+
- name: Print Docker version
96+
run: |
97+
docker --version
98+
docker version
99+
# This next bit of code is taken from:
100+
# https://github.com/kleinhenz/SlurmClusterManager.jl
101+
# Original author: Joseph Kleinhenz
102+
# License: MIT
103+
- name: Setup Slurm inside Docker
104+
run: |
105+
docker version
106+
docker compose version
107+
docker build --build-arg "JULIA_VERSION=${MATRIX_JULIA_VERSION:?}" -t slurm-cluster-julia -f ci/Dockerfile .
108+
docker compose -f ci/docker-compose.yml up -d
109+
docker ps
110+
env:
111+
MATRIX_JULIA_VERSION: ${{matrix.version}}
112+
- name: Print some information for debugging purposes
113+
run: |
114+
docker exec -t slurmctld pwd
115+
docker exec -t slurmctld ls -la
116+
docker exec -t slurmctld ls -la HTCondorClusterManager
117+
- name: Instantiate package
118+
run: docker exec -t slurmctld julia --project=HTCondorClusterManager -e 'import Pkg; @show Base.active_project(); Pkg.instantiate(); Pkg.status()'
119+
- name: Run tests without a Slurm allocation
120+
run: docker exec -t slurmctld julia --project=HTCondorClusterManager -e 'import Pkg; Pkg.test(; test_args=["slurm"])'
121+
- name: Run tests inside salloc
122+
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)'
123+
- name: Run tests inside sbatch
124+
run: docker exec -t slurmctld HTCondorClusterManager/ci/run_my_sbatch.sh
125+
- run: find . -type f -name '*.cov'
126+
- name: Copy .cov files out of the Docker container
127+
run: docker exec slurmctld /bin/bash -c 'cd /home/docker/HTCondorClusterManager && tar -cf - src/*.cov' | tar -xvf -
128+
- run: find . -type f -name '*.cov'
121129
# - 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 }}
130+
# - uses: julia-actions/julia-processcoverage@v1
131+
# - uses: codecov/codecov-action@v5
132+
# with:
133+
# files: lcov.info
134+
# token: ${{ secrets.CODECOV_TOKEN }}
135+
# # If this PR is from a fork, then do NOT fail CI if the Codecov upload errors.
136+
# # If this PR is NOT from a fork, then DO fail CI if the Codecov upload errors.
137+
# # If this is not a PR, then DO fail CI if the Codecov upload errors.
138+
# fail_ci_if_error: ${{ github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name }}
131139
example-pull-gcr:
132140
runs-on: ubuntu-latest
133141
timeout-minutes: 20

ci/htcondor/docker-compose.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
# We intentionally use full-length digests (NOT tags) for reproducibility.
24+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images:htcondor-submit
25+
image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5ada6445b5d8b53b6693ab86be364dd1ce385ada8e53763731ba50d145f0350d
26+
build:
27+
context: .
28+
target: submit
29+
hostname: submit.htcondor
30+
environment:
31+
- CONDOR_HOST=cm
32+
- USE_POOL_PASSWORD=yes
33+
- CI_SHARED_SPACE=/shared_space
34+
depends_on:
35+
- cm
36+
volumes:
37+
- secrets:/root/secrets
38+
- ../..:/dask-jobqueue
39+
- ./condor_config.local:/etc/condor/condor_config.local
40+
- shared_space:/shared_space
41+
42+
execute1:
43+
# We intentionally use full-length digests (NOT tags) for reproducibility.
44+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images:htcondor-execute
45+
image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5723d0380f627779bc54a31ebac9a77f0937189453f597845411257dea6ac0db
46+
build:
47+
context: .
48+
target: execute
49+
hostname: execute1.htcondor
50+
environment:
51+
- CONDOR_HOST=cm
52+
- USE_POOL_PASSWORD=yes
53+
depends_on:
54+
- cm
55+
volumes:
56+
- secrets:/root/secrets
57+
- ./condor_config.local:/etc/condor/condor_config.local
58+
- shared_space:/shared_space
59+
60+
execute2:
61+
# We intentionally use full-length digests (NOT tags) for reproducibility.
62+
# image: ghcr.io/juliaparallel/dask-jobqueue-ci-images:htcondor-execute
63+
image: ghcr.io/juliaparallel/dask-jobqueue-ci-images@sha256:5723d0380f627779bc54a31ebac9a77f0937189453f597845411257dea6ac0db
64+
build:
65+
context: .
66+
target: execute
67+
hostname: execute2.htcondor
68+
environment:
69+
- CONDOR_HOST=cm
70+
- USE_POOL_PASSWORD=yes
71+
depends_on:
72+
- cm
73+
volumes:
74+
- secrets:/root/secrets
75+
- ./condor_config.local:/etc/condor/condor_config.local
76+
- shared_space:/shared_space
77+
78+
volumes:
79+
secrets:
80+
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)