commit: 6af57e471c364b0feb5c452e0395708a56ac5edb Author: William Hubbs <williamh <AT> gentoo <DOT> org> AuthorDate: Mon Jul 27 22:29:31 2020 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Mon Jul 27 22:30:41 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6af57e47
sys-cluster/nomad: workload orchestrator for VMs and containers Signed-off-by: William Hubbs <williamh <AT> gentoo.org> sys-cluster/nomad/Manifest | 1 + sys-cluster/nomad/files/nomad.confd | 2 ++ sys-cluster/nomad/files/nomad.initd | 20 ++++++++++++++++ sys-cluster/nomad/files/nomad.logrotated | 7 ++++++ sys-cluster/nomad/metadata.xml | 8 +++++++ sys-cluster/nomad/nomad-0.12.1.ebuild | 41 ++++++++++++++++++++++++++++++++ 6 files changed, 79 insertions(+) diff --git a/sys-cluster/nomad/Manifest b/sys-cluster/nomad/Manifest new file mode 100644 index 00000000000..bd2b94e2844 --- /dev/null +++ b/sys-cluster/nomad/Manifest @@ -0,0 +1 @@ +DIST nomad-0.12.1.tar.gz 51227967 BLAKE2B 1354641dfcfd4d3fca44261792f65ca117be77aaf0d5a028e424b5ced2c14c1cc5e82a8dcac587c3fcb7796e8e260bee8b65fcf202ddd3b766f96373e996a874 SHA512 cbb6b2b89f4922108d10c832638460ad2b234fdfd95e61aa57fb5d89f9852dca1a42527bfd7cbcb166916394b38d7d6451c8f5fd2e56b02599926209e395d9e2 diff --git a/sys-cluster/nomad/files/nomad.confd b/sys-cluster/nomad/files/nomad.confd new file mode 100644 index 00000000000..b0a05ca40c6 --- /dev/null +++ b/sys-cluster/nomad/files/nomad.confd @@ -0,0 +1,2 @@ +# extra arguments for nomad +command_args="agent -config=/etc/nomad.d" diff --git a/sys-cluster/nomad/files/nomad.initd b/sys-cluster/nomad/files/nomad.initd new file mode 100644 index 00000000000..2c3df5ff1e0 --- /dev/null +++ b/sys-cluster/nomad/files/nomad.initd @@ -0,0 +1,20 @@ +#!/sbin/openrc-run +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="simple and flexible workload orchestrator" +command="/usr/bin/${RC_SVCNAME}" +pidfile="/run/${RC_SVCNAME}.pid" +command_background="true" +start_stop_daemon_args="--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \ + --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log" +stopsig=SIGINT +extra_started_commands=reload + +depend() { + after net +} + +reload() { + start-stop-daemon --signal HUP --pidfile "${pidfile}" +} diff --git a/sys-cluster/nomad/files/nomad.logrotated b/sys-cluster/nomad/files/nomad.logrotated new file mode 100644 index 00000000000..6cae2fdd4f7 --- /dev/null +++ b/sys-cluster/nomad/files/nomad.logrotated @@ -0,0 +1,7 @@ +/var/log/nomad/nomad.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/sys-cluster/nomad/metadata.xml b/sys-cluster/nomad/metadata.xml new file mode 100644 index 00000000000..3c49bd23955 --- /dev/null +++ b/sys-cluster/nomad/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>willi...@gentoo.org</email> + <name>William Hubbs</name> + </maintainer> + </pkgmetadata> diff --git a/sys-cluster/nomad/nomad-0.12.1.ebuild b/sys-cluster/nomad/nomad-0.12.1.ebuild new file mode 100644 index 00000000000..f51d35a6474 --- /dev/null +++ b/sys-cluster/nomad/nomad-0.12.1.ebuild @@ -0,0 +1,41 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module systemd +GIT_COMMIT=00263bf92ee3fe7964fbc08b150600a43df0abb8 + +DESCRIPTION="A simple and flexible workload orchestrator " +HOMEPAGE="https://nomadproject.io" +SRC_URI="https://github.com/hashicorp/nomad/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MPL-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +src_compile() { + local go_ldflags go_tags + go_ldflags="-X github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}" + go_tags="codegen_generated" + CGO_ENABLED=1 \ + go build \ + -trimpath \ + -ldflags "${go_ldflags}" \ + -mod=vendor \ + -tags "${go_tags}" \ + -o bin/${PN} || die "compile failed" +} + +src_install() { + dobin bin/${PN} + systemd_dounit dist/systemd/nomad.service + insinto /etc/nomad.d + newins dist/client.hcl client.hcl.example + newins dist/server.hcl server.hcl.example + keepdir /var/lib/nomad /var/log/nomad + newconfd "${FILESDIR}/nomad.confd" nomad + newinitd "${FILESDIR}/nomad.initd" nomad + insinto /etc/logrotate.d + newins "${FILESDIR}/nomad.logrotated" nomad +}