diff --git a/dev-env.hcl b/dev-env.hcl new file mode 100644 index 0000000000000000000000000000000000000000..51a4dc4af769a23f1bdaf66fe16b908420377242 --- /dev/null +++ b/dev-env.hcl @@ -0,0 +1,8 @@ +resource "network" "cloud" { + subnet = "10.10.0.0/16" +} +resource "nomad_cluster" "dev" { + network { + id = resource.network.cloud.meta.id + } +} diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..742a504ec076e76ac229ddac020aceadf187b90e --- /dev/null +++ b/setup.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 +# + +# Url to the jumppad download location +jumppad_download="https://github.com/jumppad-labs/jumppad/releases/download/0.15.0/jumppad_0.15.0_linux_x86_64.tar.gz" +levant_download="https://releases.hashicorp.com/levant/0.3.3/levant_0.3.3_linux_amd64.zip" + +mkdir -p ./.bin +bin_dir=$(realpath ./.bin) +export PATH="$PATH:$bin_dir" + +echo 'Check if jumppad is installed' +if ! [ -x "$(command -v jumppad)" ]; then + echo 'jumppad is not installed, installing' + mkdir -p ./.bin + wget -qO- "${jumppad_download}" | tar xvfz - -C "$bin_dir" + chmod +x ./.bin/jumppad +fi + +echo 'Check if levant is installed' +if ! [ -x "$(command -v levant)" ]; then + echo 'levant is not installed, installing' + mkdir -p ./.bin + wget -qO- "${levant_download}" | zcat >> ./.bin/levant + chmod +x ./.bin/levant +fi + diff --git a/simple.nomad b/simple.nomad new file mode 100644 index 0000000000000000000000000000000000000000..342b2afa5dd7ff37a9d1321f0182312dfb3c9947 --- /dev/null +++ b/simple.nomad @@ -0,0 +1,12 @@ +job "example" { + group "test" { + task "alpine" { + driver = "docker" + config { + image = "alpine:latest" + command = "sh" + args = ["-c", "while true; do sleep 300; done "] + } + } + } +}