Skip to content

Commit 55e939c

Browse files
committed
Make CI working with latest Nomad version
1 parent 0edd906 commit 55e939c

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

.github/workflows/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- name: Run containerd-driver integration tests
1414
run: |
15+
sudo modprobe bridge
1516
mkdir -p /home/runner/go/src/github.com/hashistack4u
1617
ln -s /home/runner/work/nomad-driver-containerd/nomad-driver-containerd /home/runner/go/src/github.com/hashistack4u/nomad-driver-containerd
1718
cd /home/runner/go/src/github.com/hashistack4u/nomad-driver-containerd

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Vagrant.configure("2") do |config|
2323
apt-get install -y unzip gcc runc jq make
2424
echo "export GOPATH=/home/vagrant/go" >> /home/vagrant/.bashrc
2525
echo "export PATH=$PATH:/usr/local/go/bin" >> /home/vagrant/.bashrc
26-
echo "export CONTAINERD_NAMESPACE=nomad" >> /home/vagrant/.bashrc
26+
echo "export CONTAINERD_NAMESPACE=nomad.slice" >> /home/vagrant/.bashrc
2727
source /home/vagrant/.bashrc
2828
# without keeping HOME env, 'sudo make test' will try to find files under /root/go/
2929
echo "Defaults env_keep += HOME" | sudo tee /etc/sudoers.d/keep_home

example/agent.hcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
log_level = "INFO"
22
data_dir = "/tmp/nomad"
33

4+
advertise {
5+
http = "127.0.0.1"
6+
rpc = "127.0.0.1"
7+
serf = "127.0.0.1"
8+
}
9+
410
plugin "containerd-driver" {
511
config {
612
enabled = true
@@ -30,4 +36,7 @@ client {
3036
path = "/tmp/host_volume/s1"
3137
read_only = false
3238
}
39+
options {
40+
"driver.allowlist" = "containerd-driver"
41+
}
3342
}

tests/001-test-redis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test_redis_nomad_job() {
5050
fi
5151

5252
echo "INFO: Check if memory and memory_max are set correctly in the cgroup filesystem."
53-
task_name=$(sudo CONTAINERD_NAMESPACE=nomad ctr containers ls|awk 'NR!=1'|cut -d' ' -f1)
53+
task_name=$(sudo CONTAINERD_NAMESPACE=nomad.slice ctr containers ls|awk 'NR!=1'|cut -d' ' -f1)
5454
memory_soft_limit=$(sudo cat /sys/fs/cgroup/memory/nomad/$task_name/memory.soft_limit_in_bytes)
5555
if [ $memory_soft_limit != "$(( 256 * 1024 * 1024 ))" ]; then
5656
echo "ERROR: memory should be 256 MB. Found ${memory_soft_limit}."

tests/run_tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
set -eo pipefail
44

5-
export NOMAD_VERSION=1.9.5
5+
export NOMAD_VERSION=1.9.6
66
export CONTAINERD_VERSION=1.7.25
7+
export RUNC_VERSION=1.2.4
78
export PATH=$PATH:/usr/local/go/bin
89
export PATH=$PATH:/usr/local/bin
910
if [ -e /home/runner ]; then
@@ -89,6 +90,11 @@ setup() {
8990
sudo tar -C /usr/local -xzf containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz
9091
rm -f containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz
9192

93+
# Install runc
94+
curl -L -o runc https://github.com/opencontainers/runc/releases/download/v${RUNC_VERSION}/runc.amd64
95+
chmod 0755 runc
96+
sudo mv runc /usr/local/bin/
97+
9298
# Drop containerd systemd unit file into /lib/systemd/system.
9399
cat << EOF > containerd.service
94100
# /lib/systemd/system/containerd.service

tests/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ is_container_active() {
2626
i="0"
2727
while test $i -lt 5
2828
do
29-
sudo CONTAINERD_NAMESPACE=nomad ctr task ls|grep -q RUNNING
29+
sudo CONTAINERD_NAMESPACE=nomad.slice ctr task ls|grep -q RUNNING
3030
if [ $? -eq 0 ]; then
3131
echo "INFO: ${job_name} container is up and running"
3232
if [ "$is_sleep" = true ]; then

0 commit comments

Comments
 (0)