Skip to content

Commit

Permalink
trying to get podman driver to work for nomad run
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Feb 24, 2024
1 parent a4d94ab commit 4b59011
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

# Build & deploy a Jekyll site to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["podman"]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get -yqq update && \
apt-get -yqq --no-install-recommends install \
zsh sudo rsync dnsutils supervisor curl wget iproute2 \
apt-transport-https ca-certificates software-properties-common gpgv2 gpg-agent \
podman aardvark-dns && \
podman aardvark-dns unzip && \
#
# install binaries and service files
# eg: /usr/bin/nomad $NOMAD_HCL /usr/lib/systemd/system/nomad.service
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ You can try a trivial website job spec from the cloned repo:
# you can manually set NOMAD_VAR_BASE_DOMAIN to your wildcard DNS domain name if different from
# the domain of your NOMAD_ADDR
export NOMAD_VAR_BASE_DOMAIN=$(echo "$NOMAD_ADDR" |cut -f2- -d.)
nomad run https://raw.githubusercontent.com/internetarchive/hind/main/etc/hello-world.hcl
nomad run https://internetarchive.github.io/hind/etc/hello-world.hcl
```

## Optional ways to extend your setup
Expand Down
8 changes: 8 additions & 0 deletions bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ else
fi


# make it so we can `nomad run` with jobs specifying `podman` driver
mkdir -p /opt/nomad/plugins
cd /opt/nomad/plugins
wget -qO driver.zip https://releases.hashicorp.com/nomad-driver-podman/0.5.2/nomad-driver-podman_0.5.2_linux_amd64.zip
unzip driver.zip
rm driver.zip



# fire up daemons
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
Expand Down
6 changes: 6 additions & 0 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ if [ ! -e $CONFIG ]; then
./bin/spinner 'committing bootstrapped image' podman commit hind hind

else

# set for `nomad run` of jobs with `podman` driver
podman system service -t 0 & # xxx
# test
# sudo curl -v -s --unix-socket /run/podman/podman.sock http://d/v1.0.0/libpod/info

exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
fi
8 changes: 8 additions & 0 deletions etc/nomad.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ plugin "podman" {
}
}

plugin "nomad-driver-podman" {
config {
volumes {
enabled = true
}
}
}

plugin "raw_exec" {
config {
enabled = true
Expand Down

0 comments on commit 4b59011

Please sign in to comment.