Skip to content
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

WIP Systemd Unit Artifacts #254

Merged
merged 15 commits into from
May 23, 2024

Conversation

adamperlin
Copy link
Contributor

@adamperlin adamperlin commented May 15, 2024

What this PR does / why we need it:
Adds support for specifying systemd units as artifacts in dalec. This is accomplished by adding a new services subsection to artifacts in a dalec spec that looks like the following:

 systemdUnits:
    src/simple.service:

Additional options are supported to configure the unit

src/simple.service:
     # alias name service should be installed under
     name: [email protected]
     # should service be enabled on install
     enable: true

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #225

Special notes for your reviewer:

@adamperlin adamperlin requested a review from a team as a code owner May 15, 2024 22:57
frontend/rpm/template.go Outdated Show resolved Hide resolved
test/fixtures/env-multiple-commands.yml Outdated Show resolved Hide resolved
spec.go Outdated Show resolved Hide resolved
test/fixtures/systemd-unit.yml Outdated Show resolved Hide resolved
frontend/rpm/template.go Outdated Show resolved Hide resolved
@cpuguy83 cpuguy83 added this to the v0.4.0 milestone May 17, 2024
Consolidate presets for all services into one preset file per package
Address review feedback
@@ -0,0 +1,26 @@
#!/usr/bin/python3
Copy link
Contributor Author

@adamperlin adamperlin May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file will be installed as a binary in one of the test systemd spec containers, but the endpoint it starts won't actually be checked. I'm not sure we can really do a full e2e test in our current setup since systemd must already be running in a container for the server to be initialized

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is only consumed by unutilized fixtures.
Seems like its ok to remove.

Also I'd prefer to not have to pull in python for the tests unless absolutely necessary just for the sake of test time.

spec.go Outdated Show resolved Hide resolved
@adamperlin adamperlin force-pushed the adamperlin/systemd-unit-artifacts branch from fd6fc45 to dd53ffc Compare May 22, 2024 17:05
@adamperlin adamperlin force-pushed the adamperlin/systemd-unit-artifacts branch from dd53ffc to 0c420ad Compare May 22, 2024 17:07
@adamperlin adamperlin requested a review from cpuguy83 May 22, 2024 17:15
spec.go Outdated Show resolved Hide resolved
spec.go Outdated Show resolved Hide resolved
spec.go Outdated Show resolved Hide resolved
spec.go Show resolved Hide resolved
test/fixtures/systemd-socket-unit.yml Outdated Show resolved Hide resolved
test/fixtures/systemd-unit.yml Outdated Show resolved Hide resolved
@@ -0,0 +1,26 @@
#!/usr/bin/python3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is only consumed by unutilized fixtures.
Seems like its ok to remove.

Also I'd prefer to not have to pull in python for the tests unless absolutely necessary just for the sake of test time.

go.mod Show resolved Hide resolved
test/azlinux_test.go Outdated Show resolved Hide resolved
test/azlinux_test.go Outdated Show resolved Hide resolved
spec.go Outdated Show resolved Hide resolved
Remove unneeded dependencies for systemd unit integration tests
@adamperlin adamperlin requested a review from cpuguy83 May 23, 2024 21:19
@cpuguy83 cpuguy83 merged commit b8a0e9d into Azure:main May 23, 2024
9 checks passed
@pmengelbert pmengelbert mentioned this pull request Jun 25, 2024
1 task
@adamperlin adamperlin deleted the adamperlin/systemd-unit-artifacts branch August 12, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ] Support creating systemd units
3 participants