Skip to content

Commit 42df527

Browse files
Merge pull request #109 from Roblox/version_update
Update golang, nomad, containerd and nerdctl versions
2 parents d40a7e3 + 42fc67c commit 42df527

15 files changed

+67
-63
lines changed

Vagrantfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,34 @@ Vagrant.configure("2") do |config|
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
3030
31-
# Install golang-1.14.3
31+
# Install golang-1.17
3232
if [ ! -f "/usr/local/go/bin/go" ]; then
33-
curl -s -L -o go1.14.3.linux-amd64.tar.gz https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
34-
sudo tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
33+
curl -s -L -o go1.17.linux-amd64.tar.gz https://dl.google.com/go/go1.17.linux-amd64.tar.gz
34+
sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz
3535
sudo chmod +x /usr/local/go
36-
rm -f go1.14.3.linux-amd64.tar.gz
36+
rm -f go1.17.linux-amd64.tar.gz
3737
fi
3838
39-
# Install nomad-1.1.0
39+
# Install nomad-1.1.4
4040
if [ ! -f "/usr/bin/nomad" ]; then
41-
wget --quiet https://releases.hashicorp.com/nomad/1.1.0/nomad_1.1.0_linux_amd64.zip
42-
unzip nomad_1.1.0_linux_amd64.zip -d /usr/bin
41+
wget --quiet https://releases.hashicorp.com/nomad/1.1.4/nomad_1.1.4_linux_amd64.zip
42+
unzip nomad_1.1.4_linux_amd64.zip -d /usr/bin
4343
chmod +x /usr/bin/nomad
44-
rm -f nomad_1.1.0_linux_amd64.zip
44+
rm -f nomad_1.1.4_linux_amd64.zip
4545
fi
4646
47-
# Install containerd-1.3.4
47+
# Install containerd-1.5.5
4848
if [ ! -f "/usr/local/bin/containerd" ]; then
49-
curl -L --silent -o containerd-1.3.4.linux-amd64.tar.gz https://github.com/containerd/containerd/releases/download/v1.3.4/containerd-1.3.4.linux-amd64.tar.gz
50-
tar -C /usr/local -xzf containerd-1.3.4.linux-amd64.tar.gz
51-
rm -f containerd-1.3.4.linux-amd64.tar.gz
49+
curl -L --silent -o containerd-1.5.5-linux-amd64.tar.gz https://github.com/containerd/containerd/releases/download/v1.5.5/containerd-1.5.5-linux-amd64.tar.gz
50+
tar -C /usr/local -xzf containerd-1.5.5-linux-amd64.tar.gz
51+
rm -f containerd-1.5.5-linux-amd64.tar.gz
5252
fi
5353
54-
# Install nerdctl 0.10.0
54+
# Install nerdctl 0.11.1
5555
if [ ! -f "/usr/local/bin/nerdctl" ]; then
56-
curl -L --silent -o nerdctl-0.10.0-linux-amd64.tar.gz https://github.com/containerd/nerdctl/releases/download/v0.10.0/nerdctl-0.10.0-linux-amd64.tar.gz
57-
tar -C /usr/local/bin -xzf nerdctl-0.10.0-linux-amd64.tar.gz
58-
rm -f nerdctl-0.10.0-linux-amd64.tar.gz
56+
curl -L --silent -o nerdctl-0.11.1-linux-amd64.tar.gz https://github.com/containerd/nerdctl/releases/download/v0.11.1/nerdctl-0.11.1-linux-amd64.tar.gz
57+
tar -C /usr/local/bin -xzf nerdctl-0.11.1-linux-amd64.tar.gz
58+
rm -f nerdctl-0.11.1-linux-amd64.tar.gz
5959
fi
6060
6161
# Create source directory for privileged.nomad example job.

example/agent.hcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
log_level = "INFO"
2+
data_dir = "/tmp/nomad"
23

34
plugin "containerd-driver" {
45
config {
@@ -9,6 +10,8 @@ plugin "containerd-driver" {
910
}
1011

1112
server {
13+
enabled = true
14+
bootstrap_expect = 1
1215
default_scheduler_config {
1316
scheduler_algorithm = "spread"
1417
memory_oversubscription_enabled = true
@@ -22,6 +25,7 @@ server {
2225
}
2326

2427
client {
28+
enabled = true
2529
host_volume "s1" {
2630
path = "/tmp/host_volume/s1"
2731
read_only = false

example/entrypoint.nomad

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ job "entrypoint" {
66
driver = "containerd-driver"
77

88
config {
9-
image = "ubuntu:16.04"
10-
entrypoint = ["/bin/echo"]
11-
args = ["container1", "container2"]
9+
image = "ubuntu:16.04"
10+
entrypoint = ["/bin/bash"]
11+
args = ["-c", "for i in {1..100}; do echo container1 container2; sleep 1s; done"]
1212
}
1313

1414
resources {

tests/001-test-redis.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_redis_nomad_job() {
66
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
77

88
echo "INFO: Starting nomad redis job using nomad-driver-containerd."
9-
nomad job run redis.nomad
9+
nomad job run -detach redis.nomad
1010

1111
redis_status=$(nomad job status -short redis|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
1212
if [ $redis_status != "running" ];then
@@ -63,15 +63,15 @@ test_redis_nomad_job() {
6363
fi
6464

6565
echo "INFO: Stopping nomad redis job."
66-
nomad job stop redis
66+
nomad job stop -detach redis
6767
redis_status=$(nomad job status -short redis|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
6868
if [ $redis_status != "dead(stopped)" ];then
6969
echo "ERROR: Error in stopping redis job."
7070
exit 1
7171
fi
7272

7373
echo "INFO: purge nomad redis job."
74-
nomad job stop -purge redis
74+
nomad job stop -detach -purge redis
7575
popd
7676
}
7777

tests/002-test-signal-handler.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_signal_handler_nomad_job() {
66
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
77

88
echo "INFO: Starting nomad signal handler job using nomad-driver-containerd."
9-
nomad job run signal.nomad
9+
nomad job run -detach signal.nomad
1010

1111
echo "INFO: Checking status of signal handler job."
1212
signal_status=$(nomad job status -short signal|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
@@ -40,15 +40,15 @@ test_signal_handler_nomad_job() {
4040
cleanup "$outfile"
4141

4242
echo "INFO: Stopping nomad signal handler job."
43-
nomad job stop signal
43+
nomad job stop -detach signal
4444
signal_status=$(nomad job status -short signal|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
4545
if [ $signal_status != "dead(stopped)" ];then
4646
echo "ERROR: Error in stopping signal handler job."
4747
exit 1
4848
fi
4949

5050
echo "INFO: purge nomad signal handler job."
51-
nomad job stop -purge signal
51+
nomad job stop -detach -purge signal
5252
popd
5353
}
5454

tests/003-test-capabilities.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test_capabilities_nomad_job() {
77
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
88

99
echo "INFO: Starting nomad capabilities job using nomad-driver-containerd."
10-
nomad job run capabilities.nomad
10+
nomad job run -detach capabilities.nomad
1111

1212
echo "INFO: Checking status of capabilities job."
1313
cap_status=$(nomad job status -short capabilities|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
@@ -59,15 +59,15 @@ test_capabilities_nomad_job() {
5959
cleanup "$outfile"
6060

6161
echo "INFO: Stopping nomad capabilities job."
62-
nomad job stop capabilities
62+
nomad job stop -detach capabilities
6363
cap_status=$(nomad job status -short capabilities|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
6464
if [ $cap_status != "dead(stopped)" ];then
6565
echo "ERROR: Error in stopping capabilities job."
6666
exit 1
6767
fi
6868

6969
echo "INFO: purge nomad capabilities job."
70-
nomad job stop -purge capabilities
70+
nomad job stop -detach -purge capabilities
7171
popd
7272
}
7373

tests/004-test-privileged.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_privileged_nomad_job() {
99
setup_bind_source
1010

1111
echo "INFO: Starting nomad privileged job using nomad-driver-containerd."
12-
nomad job run privileged.nomad
12+
nomad job run -detach privileged.nomad
1313

1414
echo "INFO: Checking status of privileged job."
1515
job_status=$(nomad job status -short privileged|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
@@ -68,15 +68,15 @@ test_privileged_nomad_job() {
6868
fi
6969

7070
echo "INFO: Stopping nomad privileged job."
71-
nomad job stop privileged
71+
nomad job stop -detach privileged
7272
job_status=$(nomad job status -short privileged|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
7373
if [ $job_status != "dead(stopped)" ];then
7474
echo "ERROR: Error in stopping privileged job."
7575
exit 1
7676
fi
7777

7878
echo "INFO: purge nomad privileged job."
79-
nomad job stop -purge privileged
79+
nomad job stop -detach -purge privileged
8080
popd
8181
}
8282

tests/005-test-volume-mount.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_volume_mount_nomad_job() {
1212
setup_bind_source
1313

1414
echo "INFO: Starting nomad $job_name job using nomad-driver-containerd."
15-
nomad job run $job_name.nomad
15+
nomad job run -detach $job_name.nomad
1616

1717
# Even though $(nomad job status) reports job status as "running"
1818
# The actual container process might not be running yet.
@@ -54,15 +54,15 @@ test_volume_mount_nomad_job() {
5454
fi
5555

5656
echo "INFO: Stopping nomad ${job_name} job."
57-
nomad job stop ${job_name}
57+
nomad job stop -detach ${job_name}
5858
job_status=$(nomad job status -short ${job_name}|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
5959
if [ $job_status != "dead(stopped)" ];then
6060
echo "ERROR: Error in stopping ${job_name} job."
6161
exit 1
6262
fi
6363

6464
echo "INFO: purge nomad ${job_name} job."
65-
nomad job stop -purge ${job_name}
65+
nomad job stop -detach -purge ${job_name}
6666
popd
6767
}
6868

tests/006-test-dns.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test_dns_nomad_job() {
88
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
99

1010
echo "INFO: Starting nomad $job_name job using nomad-driver-containerd."
11-
nomad job run $job_name.nomad
11+
nomad job run -detach $job_name.nomad
1212

1313
# Even though $(nomad job status) reports job status as "running"
1414
# The actual container process might not be running yet.
@@ -62,15 +62,15 @@ test_dns_nomad_job() {
6262
fi
6363

6464
echo "INFO: Stopping nomad ${job_name} job."
65-
nomad job stop ${job_name}
65+
nomad job stop -detach ${job_name}
6666
job_status=$(nomad job status -short ${job_name}|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
6767
if [ $job_status != "dead(stopped)" ];then
6868
echo "ERROR: Error in stopping ${job_name} job."
6969
exit 1
7070
fi
7171

7272
echo "INFO: purge nomad ${job_name} job."
73-
nomad job stop -purge ${job_name}
73+
nomad job stop -detach -purge ${job_name}
7474
popd
7575
}
7676

tests/007-test-extra-hosts.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test_extra_hosts_nomad_job() {
88
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
99

1010
echo "INFO: Starting nomad $job_name job using nomad-driver-containerd."
11-
nomad job run $job_name.nomad
11+
nomad job run -detach $job_name.nomad
1212

1313
# Even though $(nomad job status) reports job status as "running"
1414
# The actual container process might not be running yet.
@@ -34,15 +34,15 @@ test_extra_hosts_nomad_job() {
3434
done
3535

3636
echo "INFO: Stopping nomad ${job_name} job."
37-
nomad job stop ${job_name}
37+
nomad job stop -detach ${job_name}
3838
job_status=$(nomad job status -short ${job_name}|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')
3939
if [ $job_status != "dead(stopped)" ];then
4040
echo "ERROR: Error in stopping ${job_name} job."
4141
exit 1
4242
fi
4343

4444
echo "INFO: purge nomad ${job_name} job."
45-
nomad job stop -purge ${job_name}
45+
nomad job stop -detach -purge ${job_name}
4646
popd
4747
}
4848

0 commit comments

Comments
 (0)