Skip to content

Commit

Permalink
Merge pull request #109 from Roblox/version_update
Browse files Browse the repository at this point in the history
Update golang, nomad, containerd and nerdctl versions
  • Loading branch information
shishir-a412ed authored Sep 3, 2021
2 parents d40a7e3 + 42fc67c commit 42df527
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 63 deletions.
32 changes: 16 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,34 @@ Vagrant.configure("2") do |config|
# without keeping HOME env, 'sudo make test' will try to find files under /root/go/
echo "Defaults env_keep += HOME" | sudo tee /etc/sudoers.d/keep_home
# Install golang-1.14.3
# Install golang-1.17
if [ ! -f "/usr/local/go/bin/go" ]; then
curl -s -L -o go1.14.3.linux-amd64.tar.gz https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
curl -s -L -o go1.17.linux-amd64.tar.gz https://dl.google.com/go/go1.17.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz
sudo chmod +x /usr/local/go
rm -f go1.14.3.linux-amd64.tar.gz
rm -f go1.17.linux-amd64.tar.gz
fi
# Install nomad-1.1.0
# Install nomad-1.1.4
if [ ! -f "/usr/bin/nomad" ]; then
wget --quiet https://releases.hashicorp.com/nomad/1.1.0/nomad_1.1.0_linux_amd64.zip
unzip nomad_1.1.0_linux_amd64.zip -d /usr/bin
wget --quiet https://releases.hashicorp.com/nomad/1.1.4/nomad_1.1.4_linux_amd64.zip
unzip nomad_1.1.4_linux_amd64.zip -d /usr/bin
chmod +x /usr/bin/nomad
rm -f nomad_1.1.0_linux_amd64.zip
rm -f nomad_1.1.4_linux_amd64.zip
fi
# Install containerd-1.3.4
# Install containerd-1.5.5
if [ ! -f "/usr/local/bin/containerd" ]; then
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
tar -C /usr/local -xzf containerd-1.3.4.linux-amd64.tar.gz
rm -f containerd-1.3.4.linux-amd64.tar.gz
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
tar -C /usr/local -xzf containerd-1.5.5-linux-amd64.tar.gz
rm -f containerd-1.5.5-linux-amd64.tar.gz
fi
# Install nerdctl 0.10.0
# Install nerdctl 0.11.1
if [ ! -f "/usr/local/bin/nerdctl" ]; then
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
tar -C /usr/local/bin -xzf nerdctl-0.10.0-linux-amd64.tar.gz
rm -f nerdctl-0.10.0-linux-amd64.tar.gz
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
tar -C /usr/local/bin -xzf nerdctl-0.11.1-linux-amd64.tar.gz
rm -f nerdctl-0.11.1-linux-amd64.tar.gz
fi
# Create source directory for privileged.nomad example job.
Expand Down
4 changes: 4 additions & 0 deletions example/agent.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
log_level = "INFO"
data_dir = "/tmp/nomad"

plugin "containerd-driver" {
config {
Expand All @@ -9,6 +10,8 @@ plugin "containerd-driver" {
}

server {
enabled = true
bootstrap_expect = 1
default_scheduler_config {
scheduler_algorithm = "spread"
memory_oversubscription_enabled = true
Expand All @@ -22,6 +25,7 @@ server {
}

client {
enabled = true
host_volume "s1" {
path = "/tmp/host_volume/s1"
read_only = false
Expand Down
6 changes: 3 additions & 3 deletions example/entrypoint.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ job "entrypoint" {
driver = "containerd-driver"

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

resources {
Expand Down
6 changes: 3 additions & 3 deletions tests/001-test-redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_redis_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

echo "INFO: Starting nomad redis job using nomad-driver-containerd."
nomad job run redis.nomad
nomad job run -detach redis.nomad

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

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

echo "INFO: purge nomad redis job."
nomad job stop -purge redis
nomad job stop -detach -purge redis
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/002-test-signal-handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_signal_handler_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

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

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

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

echo "INFO: purge nomad signal handler job."
nomad job stop -purge signal
nomad job stop -detach -purge signal
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/003-test-capabilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_capabilities_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

echo "INFO: Starting nomad capabilities job using nomad-driver-containerd."
nomad job run capabilities.nomad
nomad job run -detach capabilities.nomad

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

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

echo "INFO: purge nomad capabilities job."
nomad job stop -purge capabilities
nomad job stop -detach -purge capabilities
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/004-test-privileged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_privileged_nomad_job() {
setup_bind_source

echo "INFO: Starting nomad privileged job using nomad-driver-containerd."
nomad job run privileged.nomad
nomad job run -detach privileged.nomad

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

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

echo "INFO: purge nomad privileged job."
nomad job stop -purge privileged
nomad job stop -detach -purge privileged
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/005-test-volume-mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_volume_mount_nomad_job() {
setup_bind_source

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

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

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

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/006-test-dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_dns_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

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

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

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

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/007-test-extra-hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_extra_hosts_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

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

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

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

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}
popd
}

Expand Down
4 changes: 2 additions & 2 deletions tests/008-test-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_entrypoint_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

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

# Even though $(nomad job status) reports job status as "running"
# The actual container process might not be running yet.
Expand All @@ -33,7 +33,7 @@ test_entrypoint_nomad_job() {
done

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}
popd
}

Expand Down
4 changes: 2 additions & 2 deletions tests/009-test-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_auth_nomad_job() {
pushd ~/go/src/github.com/Roblox/nomad-driver-containerd/example

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

wait_nomad_job_status $job_name failed

Expand All @@ -23,7 +23,7 @@ test_auth_nomad_job() {
fi

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}
popd
}

Expand Down
6 changes: 3 additions & 3 deletions tests/010-test-allow-privileged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ test_allow_privileged() {

cp agent.hcl agent.hcl.bkp

sed -i '8 i \ allow_privileged = false' agent.hcl
sed -i '9 i \ allow_privileged = false' agent.hcl
sudo systemctl restart nomad
is_systemd_service_active "nomad.service" true

echo "INFO: Starting nomad ${job_name} job using nomad-driver-containerd."
nomad job run privileged_not_allowed.nomad
nomad job run -detach privileged_not_allowed.nomad
# Sleep for 5 seconds, to allow ${alloc_id} to get populated.
sleep 5s

Expand All @@ -28,7 +28,7 @@ test_allow_privileged() {
fi

echo "INFO: purge nomad ${job_name} job."
nomad job stop -purge ${job_name}
nomad job stop -detach -purge ${job_name}

mv agent.hcl.bkp agent.hcl
popd
Expand Down
Loading

0 comments on commit 42df527

Please sign in to comment.