[gentoo-commits] repo/gentoo:master commit in: sys-cluster/nomad/, sys-cluster/nomad/files/

2022-02-15 Thread William Hubbs
commit: c21bc0f0950d9fbacfcd7c008176e927c726ce7e
Author: William Hubbs  gentoo  org>
AuthorDate: Tue Feb 15 17:36:40 2022 +
Commit: William Hubbs  gentoo  org>
CommitDate: Tue Feb 15 17:39:50 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c21bc0f0

sys-cluster/nomad:  1.2.6 bump

Bug: https://bugs.gentoo.org/812494
Bug: https://bugs.gentoo.org/833157
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: William Hubbs  gentoo.org>

 sys-cluster/nomad/Manifest|  2 ++
 sys-cluster/nomad/files/nomad.service | 29 +
 sys-cluster/nomad/nomad-1.2.6.ebuild  | 49 +++
 3 files changed, 80 insertions(+)

diff --git a/sys-cluster/nomad/Manifest b/sys-cluster/nomad/Manifest
index babde4a95dd3..b38f14d5d906 100644
--- a/sys-cluster/nomad/Manifest
+++ b/sys-cluster/nomad/Manifest
@@ -1 +1,3 @@
 DIST nomad-1.0.9.tar.gz 40563203 BLAKE2B 
5db3bce093ae873907572e5f67640fac162e4c4ffe436f2acd3ac9fe8da509f451ff73c948dcd49d10eb101afdfe5285b2906986983b938034c64aab8d0cab4d
 SHA512 
66a00f15a16b57e8a3f97c43301bd9aaab76e185b56fe45193eb0e7c25e83fbcf1a7072f2d5fe4c533a00e63c71f3ec941a05cf6aa50f5051b8f3b5588b50463
+DIST nomad-1.2.6-vendor.tar.xz 8019208 BLAKE2B 
f972a84d201328f95e13a68fdc6dc0f0db5aff6d7ff98f5478ef310c6349fb4c0d9e5aa9c638ae81fb9f2776fa4d252c3b1daed091d3b9ae6d86a75d79e2ac0e
 SHA512 
8d53eaa771847d862f14c3fad286fe42b5c4426b242b18d2b900e4807221e6624b8bb129f34c560078d8863ce19b58c6637d2cc806950fffb5140b8d44f44c8f
+DIST nomad-1.2.6.tar.gz 29585632 BLAKE2B 
1b9ecbb11ddc59f8078831c6d41b8547a572c3b8475a21d65b8333204bdd2a6ee646cc7c5ec2bdffaee6c1b3cdf2dc30a667464695057e49c2bca41128b61452
 SHA512 
93a3ed9b0d992ba25cb126496cb9ed250195d8b8011312ebc4cffdf5f9f8786bc43cbe18cefc820597b8a117a05f6118e2e4a88e25e738c1bd309c5504e93ed9

diff --git a/sys-cluster/nomad/files/nomad.service 
b/sys-cluster/nomad/files/nomad.service
new file mode 100644
index ..08b243206d1b
--- /dev/null
+++ b/sys-cluster/nomad/files/nomad.service
@@ -0,0 +1,29 @@
+[Unit]
+Description=Nomad
+Documentation=https://nomadproject.io/docs/
+Wants=network-online.target
+After=network-online.target
+
+# When using Nomad with Consul it is not necessary to start Consul first. These
+# lines start Consul before Nomad as an optimization to avoid Nomad logging
+# that Consul is unavailable at startup.
+#Wants=consul.service
+#After=consul.service
+
+[Service]
+EnvironmentFile=/etc/nomad.d/nomad.env
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStart=/usr/bin/nomad agent -config /etc/nomad.d
+KillMode=process
+KillSignal=SIGINT
+LimitNOFILE=65536
+LimitNPROC=infinity
+Restart=on-failure
+RestartSec=2
+StartLimitBurst=3
+StartLimitInterval=10
+TasksMax=infinity
+OOMScoreAdjust=-1000
+
+[Install]
+WantedBy=multi-user.target

diff --git a/sys-cluster/nomad/nomad-1.2.6.ebuild 
b/sys-cluster/nomad/nomad-1.2.6.ebuild
new file mode 100644
index ..e7175e4427d5
--- /dev/null
+++ b/sys-cluster/nomad/nomad-1.2.6.ebuild
@@ -0,0 +1,49 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit go-module systemd
+GIT_COMMIT=95514d569610f15ce49b4a7a1a6bfd3e7b3e7b4f
+
+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"
+SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-vendor.tar.xz;
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RESTRICT=" test"
+
+src_prepare() {
+   default
+   if [[ -d ../vendor ]]; then
+   mv ../vendor . || die
+   fi
+}
+
+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 \
+   -ldflags "${go_ldflags}" \
+   -tags "${go_tags}" \
+   -trimpath \
+   -o bin/${PN} || die "compile failed"
+}
+
+src_install() {
+   dobin bin/${PN}
+   systemd_dounit "${FILESDIR}"/nomad.service
+   keepdir /etc/nomad.d
+   einstalldocs
+   dodoc CHANGELOG.md
+   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
+}



[gentoo-commits] repo/gentoo:master commit in: sys-cluster/nomad/, sys-cluster/nomad/files/

2020-07-27 Thread William Hubbs
commit: 6af57e471c364b0feb5c452e0395708a56ac5edb
Author: William Hubbs  gentoo  org>
AuthorDate: Mon Jul 27 22:29:31 2020 +
Commit: William Hubbs  gentoo  org>
CommitDate: Mon Jul 27 22:30:41 2020 +
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  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 000..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 000..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 000..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 000..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 000..3c49bd23955
--- /dev/null
+++ b/sys-cluster/nomad/metadata.xml
@@ -0,0 +1,8 @@
+
+http://www.gentoo.org/dtd/metadata.dtd;>
+
+   
+   willi...@gentoo.org
+   William Hubbs
+   
+   

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 000..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
+}