diff options
author | William Hubbs <williamh@gentoo.org> | 2020-07-27 17:29:31 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2020-07-27 17:30:41 -0500 |
commit | 6af57e471c364b0feb5c452e0395708a56ac5edb (patch) | |
tree | b8532c031dd1ce7fac8a9fd93c76484410ec3f8d /sys-cluster/nomad | |
parent | mail-client/neomutt: x86 stable (bug #728302) (diff) | |
download | gentoo-6af57e471c364b0feb5c452e0395708a56ac5edb.tar.gz gentoo-6af57e471c364b0feb5c452e0395708a56ac5edb.tar.bz2 gentoo-6af57e471c364b0feb5c452e0395708a56ac5edb.zip |
sys-cluster/nomad: workload orchestrator for VMs and containers
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'sys-cluster/nomad')
-rw-r--r-- | sys-cluster/nomad/Manifest | 1 | ||||
-rw-r--r-- | sys-cluster/nomad/files/nomad.confd | 2 | ||||
-rw-r--r-- | sys-cluster/nomad/files/nomad.initd | 20 | ||||
-rw-r--r-- | sys-cluster/nomad/files/nomad.logrotated | 7 | ||||
-rw-r--r-- | sys-cluster/nomad/metadata.xml | 8 | ||||
-rw-r--r-- | sys-cluster/nomad/nomad-0.12.1.ebuild | 41 |
6 files changed, 79 insertions, 0 deletions
diff --git a/sys-cluster/nomad/Manifest b/sys-cluster/nomad/Manifest new file mode 100644 index 000000000000..bd2b94e28449 --- /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 000000000000..b0a05ca40c60 --- /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 000000000000..2c3df5ff1e0e --- /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 000000000000..6cae2fdd4f76 --- /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 000000000000..3c49bd23955c --- /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>williamh@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 000000000000..f51d35a6474b --- /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 +} |