-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deb and rpm packaging for all binaries #6456
deb and rpm packaging for all binaries #6456
Conversation
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0.1%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0.6% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @julienduchesne! 🎉
@KMiller-Grafana could you please have a look at the verbiage in tools/package-nfpm.jsonnet
to see if there's anything you'd like to change before I merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your efforts to make OS packages happen also for Loki. However I have a big concern which I raised in a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this started 🙂
bdea709
to
9868c51
Compare
2f4fb48
to
505e063
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File contents for tools/packaging/nfpm.jsonnet look good to me.
60d654a
to
49b73e3
Compare
@jeschkies @chaudum. Re-requesting a review. I added systemd configs for both deb and RPM. I also added a CI test to check that everything keeps working. The CI check uses CentOS and Debian. It installs loki and promtail and then queries with logcli to see that everything works well |
49b73e3
to
bfa9c6a
Compare
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0.1%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really awesome! Just so I understand. The packages are not published yet, right?
.drone/drone.jsonnet
Outdated
}), | ||
run('test packaging', | ||
commands=[ | ||
'go install github.com/google/go-jsonnet/cmd/jsonnet@latest', // Test, install in build image instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this step. Why do you install a Go dependency here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installed in the build image here: #6526
{ | ||
name: 'test deb package', | ||
image: 'docker', | ||
commands: ['./tools/packaging/verify-deb-install.sh'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. I'd use some test library but am totally fine with a shell script for now.
for name in loki loki-canary logcli promtail; do | ||
for arch in amd64 arm64 arm; do | ||
config_path="dist/tmp/config-${name}-${arch}.json" | ||
jsonnet -V "name=${name}" -V "arch=${arch}" "tools/packaging/nfpm.jsonnet" > "${config_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...ah this is why you need to install Jsonnet 🙂
|
||
cat <<EOF | docker exec --interactive "${image}" sh | ||
# Install loki and check it's running | ||
dpkg -i ${dir}/dist/loki_0.0.0~rc0_amd64.deb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the binary have a version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh dang, that'll fail on actual releases. Will fix
sleep 5 | ||
labels_found=\$(logcli labels) | ||
echo "Found labels: \$labels_found" | ||
[ "\$labels_found" != "" ] || (echo "no logs found with logcli" && exit 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use a loop but this is a great start. We can always iterate.
No, we're working on a global repository (apt.grafana.com and rpm.grafana.com) where we will publish all packages. It'll just be an additional Drone step. For now, the deb and rpm files will be in the releases. I'm hoping to have the repositories ready before end of July |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. - ingester -0.1%
- distributor -0.3%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
@julienduchesne The debian package will install directly on the system not through docker? Where can I see what the |
dst: '/etc/systemd/system/loki.service', | ||
}, | ||
{ | ||
src: './cmd/loki/loki-local-config.yaml', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config file configures Loki to write to /tmp/loki
. Not sure if this is the ideal default location, but I think it's good enough for a first iteration.
* Add jsonnet to build image Needed for #6456 * Add pipeline step to build image
0b98a00
to
faf6c92
Compare
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0.3%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Type=simple | ||
User=promtail | ||
ExecStart=/usr/bin/promtail -config.file /etc/promtail/config.yml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be a neat idea if promtail would also be Restart = on-failure
, just like in loki.service
?
There is currently deb and rpm packages being published for logcli amd64 but they aren't signed In this PR: - Add RPM and deb packages for `logcli`, `loki-canary` `loki` and `promtail` for arm, arm64 and amd64 - Sign them with the Grafana GPG key (packages.grafana.com/gpg.key). This will be the same key for all Grafana products - Add CI steps to test the RPM and deb packages. This launches a docker image with systemd installed, then it installs both loki and promtail and does a `logcli` query on the Loki instance
faf6c92
to
dcc0d74
Compare
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
* deb and rpm packaging for all binaries There is currently deb and rpm packages being published for logcli amd64 but they aren't signed In this PR: - Add RPM and deb packages for `logcli`, `loki-canary` `loki` and `promtail` for arm, arm64 and amd64 - Sign them with the Grafana GPG key (packages.grafana.com/gpg.key). This will be the same key for all Grafana products - Add CI steps to test the RPM and deb packages. This launches a docker image with systemd installed, then it installs both loki and promtail and does a `logcli` query on the Loki instance * Remove specific version in test scripts * Bump build image to 0.22.0 * Add restart policy for promtail's service
**What this PR does / why we need it**: With #6456 we started providing native packages of Loki, Promtail and logcli. They've been added to Grafana's repository in the meantime. In order to spread the knowledge of the packages and the repo it should be documented. **Which issue(s) this PR fixes**: Fixes #52 **Checklist** - [ ] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md` --------- Co-authored-by: René Scheibe <rene.scheibe@gmail.com> Co-authored-by: J Stickler <julie.stickler@grafana.com>
There is currently deb and rpm packages being published for logcli amd64 but they aren't signed
In this PR:
logcli
,loki-canary
loki
andpromtail
for arm, arm64 and amd64logcli
query on the Loki instance