summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Loibl2021-10-11 12:38:36 +0200
committerMatthias Loibl2021-10-11 12:38:36 +0200
commitcd9d1a607fd2e724061e6c668c9c4ae4130b8f44 (patch)
tree8ffd7bfe12b07aa77b5fc33fe029471b68c7657f
downloadaur-cd9d1a607fd2e724061e6c668c9c4ae4130b8f44.tar.gz
Initial release v0.1.0
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD62
-rw-r--r--parca.conf1
-rw-r--r--parca.service28
-rw-r--r--parca.sysusers1
6 files changed, 117 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1e7283ac07f9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = parca
+ pkgdesc = Continuous profiling for analysis of CPU, memory usage over time, and down to the line number.
+ pkgver = 0.1.0
+ pkgrel = 1
+ url = https://parca.dev
+ arch = x86_64
+ license = Apache
+ makedepends = go
+ makedepends = git
+ makedepends = nodejs
+ makedepends = yarn
+ backup = etc/parca/parca.yml
+ backup = etc/conf.d/parca
+ source = parca-v0.1.0.tar.gz::https://github.com/parca-dev/parca/archive/refs/tags/v0.1.0.tar.gz
+ source = parca.service
+ source = parca.sysusers
+ source = parca.conf
+ sha256sums = cd7d55999e72bf8a07a8e481701d80204e5a974da9489bd94ff376e6ff64c2f0
+ sha256sums = 7ed83cee9ef9b186fdb26e48f19d1f0d37960afe6d983341e253db6a23bf7fe6
+ sha256sums = 4e3462335427c83919a58c6060f194e4c45b76234b24f330a06b1ecf16789de0
+ sha256sums = d917730e72fc1db483fc7a64e4ade9c4cebb91df9199b3981a3a107232602e23
+
+pkgname = parca
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..e9648f0f4308
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e9ef641a4e07
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Matthias Loibl <mail@matthiasloibl.com>
+# Maintainer: Kemal Akkoyun <kakkoyun@gmail.com>
+
+pkgname=parca
+pkgver=0.1.0
+pkgrel=1
+
+pkgdesc='Continuous profiling for analysis of CPU, memory usage over time, and down to the line number.'
+url='https://parca.dev'
+arch=('x86_64')
+license=('Apache')
+
+makedepends=('go' 'git' 'nodejs' 'yarn')
+
+backup=('etc/parca/parca.yml' 'etc/conf.d/parca')
+
+source=("parca-v$pkgver.tar.gz::https://github.com/parca-dev/parca/archive/refs/tags/v${pkgver}.tar.gz"
+ parca.service
+ parca.sysusers
+ parca.conf)
+
+sha256sums=('cd7d55999e72bf8a07a8e481701d80204e5a974da9489bd94ff376e6ff64c2f0'
+ '7ed83cee9ef9b186fdb26e48f19d1f0d37960afe6d983341e253db6a23bf7fe6'
+ '4e3462335427c83919a58c6060f194e4c45b76234b24f330a06b1ecf16789de0'
+ 'd917730e72fc1db483fc7a64e4ade9c4cebb91df9199b3981a3a107232602e23')
+
+build() {
+ # The makefile seems to not be able to execute npm properly, so run the make assets target manually
+ cd $srcdir/parca-$pkgver/ui
+ yarn install
+ yarn workspace @parca/web build
+
+ cd $srcdir/parca-$pkgver
+ # Build the react app, normally a part of the assets target
+ # make web/ui/static/react
+
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external" \
+ ./cmd/parca
+}
+
+# Fails due to some proftest...
+# check() {
+# cd $srcdir/parca-$pkgver
+# go test -short ./...
+# }
+
+package() {
+ install -Dm644 parca.service "$pkgdir"/usr/lib/systemd/system/parca.service
+ install -Dm644 parca.sysusers "$pkgdir"/usr/lib/sysusers.d/parca.conf
+ install -Dm644 parca.conf "${pkgdir}"/etc/conf.d/parca
+
+ cd $srcdir/parca-$pkgver
+
+ install -Dm755 -t "$pkgdir"/usr/bin parca
+ install -Dm640 -g parca -t "$pkgdir"/etc/parca parca.yaml
+ install -dm750 -o parca -g parca "$pkgdir"/var/lib/parca
+}
diff --git a/parca.conf b/parca.conf
new file mode 100644
index 000000000000..05e25ad3ba60
--- /dev/null
+++ b/parca.conf
@@ -0,0 +1 @@
+PARCA_ARGS=""
diff --git a/parca.service b/parca.service
new file mode 100644
index 000000000000..387655371418
--- /dev/null
+++ b/parca.service
@@ -0,0 +1,28 @@
+[Unit]
+Description=Parca service
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+User=parca
+Group=parca
+Restart=on-failure
+WorkingDirectory=/var/lib/parca
+EnvironmentFile=-/etc/conf.d/parca
+ExecStart=/usr/bin/parca --config-path=/etc/parca/parca.yaml $PARCA_ARGS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitNOFILE=65535
+NoNewPrivileges=true
+ProtectHome=true
+ProtectHostname=true
+ProtectControlGroups=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+LockPersonality=true
+RestrictRealtime=yes
+RestrictNamespaces=yes
+MemoryDenyWriteExecute=yes
+CapabilityBoundingSet=
+
+[Install]
+WantedBy=multi-user.target
diff --git a/parca.sysusers b/parca.sysusers
new file mode 100644
index 000000000000..f333fcf5dbaa
--- /dev/null
+++ b/parca.sysusers
@@ -0,0 +1 @@
+u parca - "Parca dedicated user"