From bbe249adb3a4e8283c0a1949959b7825985fb902 Mon Sep 17 00:00:00 2001 From: Anton Schubert Date: Sun, 14 Feb 2021 00:34:47 +0100 Subject: [PATCH] sys-cluster/nomad: add nomad with ui support Package-Manager: Portage-3.0.13, Repoman-3.0.2 --- sys-cluster/nomad/Manifest | 6 ++++ 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 | 12 +++++++ sys-cluster/nomad/nomad-1.0.3.ebuild | 45 ++++++++++++++++++++++++ 6 files changed, 92 insertions(+) create mode 100644 sys-cluster/nomad/Manifest create mode 100644 sys-cluster/nomad/files/nomad.confd create mode 100644 sys-cluster/nomad/files/nomad.initd create mode 100644 sys-cluster/nomad/files/nomad.logrotated create mode 100644 sys-cluster/nomad/metadata.xml create mode 100644 sys-cluster/nomad/nomad-1.0.3.ebuild diff --git a/sys-cluster/nomad/Manifest b/sys-cluster/nomad/Manifest new file mode 100644 index 0000000..77dcecd --- /dev/null +++ b/sys-cluster/nomad/Manifest @@ -0,0 +1,6 @@ +AUX nomad.confd 70 BLAKE2B e7cd65e529d1a8d99212a3267d3dc8d6f6d8b310f7cbda77e31f6c6e26af41fe6866ea1c9dd579caa89b39edff2e7f70553d70d600e84cdc04dea25d50ed8883 SHA512 c4e646b97335123c6411b0a556eefb4a59198db3277ed5a833410b25a7ab9601548a5cb7dd041e031e55098e4d4c022d4b16b0ae9ba1a32358eb5d9403f4d7e9 +AUX nomad.initd 539 BLAKE2B c474c9e32498b109f69e935f23f3b18ad29180eae60df3e9222b37c1c5ef3ded5ec1baadd6526a9c6d311d50ab8e68c7d1cf78969ddf538775aff4daa3837ac7 SHA512 b120aca50473e8fb2c262bd985271d0dea4a40d512e63e5b43f154321d19a6f6865998600dbf325a8f892c63e4e32183b951beb0bcb1160f50a955ce07228fab +AUX nomad.logrotated 83 BLAKE2B 2c970621c10520b2aaa17172d9c99a741737393db9a6424278e12d8b6676492c97b628d4be419ab921f7cf7685bae1a5e93eb04efa2ca6242012cfde203e02da SHA512 0ebdbeab15b01145eb2b33e0c6fd43dde3e4ac8eae9d8aff81797688276530732f613a39cd658fa4f5c2e8c99d70e6255f814ca5f3cd2bc5de259be324ab2851 +DIST nomad-1.0.3.tar.gz 39597940 BLAKE2B 355d9e802cf5899c894ca611bd265ab85968122081a92bb455df9129a588094c9190638a5af8b9ecf7d105cba94e328ce80ad99fb4596b281939fe084040ad21 SHA512 a0919027430e435eeb62fe03d56aeda538479c5b3e4b7392d0c5683a7b624113cd2a09fe22717b1b8c94cbb6da9a2ec62ca98117e599ff90143fd9cf8ea378ce +EBUILD nomad-1.0.3.ebuild 1221 BLAKE2B 17ba4145055b333ee97ab5b5e81b4217e5e96c7711defd19bf824cd3dc46e38572f528592f08857110b9002cc062354626504fc938b7aa85c2e403caa51dbae8 SHA512 2ed79ba6d865139ff606257c0c17969b6c1c2e07cf76691c3a96a0c9e6ad6297ac5fa954b5fa402e966afc2df8c31c7671b2bc76e039aec8c564ff81369a7f7b +MISC metadata.xml 367 BLAKE2B 8c3024782683a52c7aa90a56cf1f866444596708705f5ada9b5a5931f86b05285e01ab3ba3df7b2bcde198c1519a6d7674340179a4596bf306f6d3bc8af7532b SHA512 050c50e073c92951875cea633c5ae249e34610e6dcf5cbd492f67a45794fe643b770863d0857d70e1cbfb961971e94d09bef09ea28af3a396856202c66e24c14 diff --git a/sys-cluster/nomad/files/nomad.confd b/sys-cluster/nomad/files/nomad.confd new file mode 100644 index 0000000..b0a05ca --- /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 0000000..d7ac50a --- /dev/null +++ b/sys-cluster/nomad/files/nomad.initd @@ -0,0 +1,20 @@ +#!/sbin/openrc-run +# Copyright 2020-2021 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 0000000..6cae2fd --- /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 0000000..7b7936f --- /dev/null +++ b/sys-cluster/nomad/metadata.xml @@ -0,0 +1,12 @@ + + + + + williamh@gentoo.org + William Hubbs + + + build with nvidia integration + build with webui + + diff --git a/sys-cluster/nomad/nomad-1.0.3.ebuild b/sys-cluster/nomad/nomad-1.0.3.ebuild new file mode 100644 index 0000000..16d001c --- /dev/null +++ b/sys-cluster/nomad/nomad-1.0.3.ebuild @@ -0,0 +1,45 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module systemd +GIT_COMMIT=d79b74c937496a7b94146b3615996652c5d27c58 + +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="nvidia ui" + +RESTRICT+=" test" + +src_compile() { + local go_ldflags go_tags + go_ldflags="-X github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}" + go_tags="codegen_generated $(usex nvidia '' 'nonvidia') $(usex ui 'ui' '') release" + CGO_ENABLED=1 \ + go build \ + -ldflags "${go_ldflags}" \ + -mod=vendor \ + -tags "${go_tags}" \ + -trimpath \ + -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 + 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 +}