Skip to content

Commit

Permalink
workflow: install cni plguins and test with nomad 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Jun 6, 2024
1 parent 4a5212b commit 55b564a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ env:
jobs:
test:
strategy:
max-parallel: 1
max-parallel: 2
matrix:
include:
- nomad: 1.7.5
- nomad: 1.8.0
python: 3.12
- nomad: 1.6.8
python: 3.7
Expand All @@ -27,9 +27,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path:
./requirements.txt
./requirements-test.txt
cache-dependency-path: ./requirements*.txt
- name: install editable package
run: pip install -e .
- name: install test requirements
Expand All @@ -38,6 +36,8 @@ jobs:
uses: jakebailey/pyright-action@v2
- name: run unit tests
run: ./unit_tests.sh --durations=10 -n auto
- name: install cni
run: bash ./tests/provision.sh cni_install
- name: install nomad server
run: bash ./tests/provision.sh nomad_install ${{ matrix.nomad }}
- name: run nomad server
Expand Down
1 change: 1 addition & 0 deletions tests/nomad.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ client {
force = true
ignore_system_jobs = false
}
cni_path = "/opt/cni/bin:/usr/lib/cni"
}
limits {
http_max_conns_per_client = 10000
Expand Down
9 changes: 8 additions & 1 deletion tests/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ nomad_install() {
fi
}

cni_install() {
sudo mkdir -vp /opt/cni/bin
wget -q https://github.com/containernetworking/plugins/releases/download/v1.5.0/cni-plugins-linux-amd64-v1.5.0.tgz
sudo tar xafvp cni-plugins*.tgz -C /opt/cni/bin
sudo rm cni-plugins*.tgz
}

nomad_start() {
local pid now endtime
if pid=$(pgrep nomad); then
Expand Down Expand Up @@ -72,7 +79,7 @@ vagrant() {
}

case "$1" in
nomad_install | nomad_start | nomad_restart | vagrant)
cni_install | nomad_install | nomad_start | nomad_restart | vagrant)
"$@"
;;
*)
Expand Down

0 comments on commit 55b564a

Please sign in to comment.