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

Bug: fix the aa-kbc-params error in fedora #1853

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cloud-api-adaptor/cmd/process-user-data/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
providerAzure = "azure"
providerAws = "aws"

defaultAgentConfigPath = "/etc/agent-config.toml"
defaultAgentConfigPath = "/run/peerpod/agent-config.toml"
Copy link
Member

Choose a reason for hiding this comment

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

the defaultAgentConfigPath is changed here but
src/cloud-api-adaptor/podvm/files/etc/systemd/system/kata-agent.service didn't use the new changed path.

Copy link
Author

Choose a reason for hiding this comment

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

@liudalibj thanks for finding it, I think that's another reason why it works on ubuntu but not on fedora, fedora altered the path to /run/peerpod/agent-config.toml here https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/podvm-mkosi/mkosi.skeleton/usr/lib/systemd/system/kata-agent.service.d/10-override.conf

Copy link
Author

Choose a reason for hiding this comment

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

I guess we should change to use /run/peerpod/agent-config.toml on ubuntu also.

Copy link
Author

Choose a reason for hiding this comment

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

I'll give a try after update the path...

Copy link
Member

Choose a reason for hiding this comment

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

defaultAuthJsonPath = "/run/peerpod/auth.json"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Distribution=fedora

[Distribution]
Distribution=fedora
Release=38
Release=39
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we want to bump fedora, can we do this in a separate PR?


[Content]
CleanPackageMetadata=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Distribution=fedora

[Distribution]
Distribution=fedora
Release=38
Release=39

[Content]
CleanPackageMetadata=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Build binaries for mkosi podvm image
#
FROM registry.fedoraproject.org/fedora:38
FROM registry.fedoraproject.org/fedora:39

ARG ARCH="amd64"
ARG YQ_ARCH="amd64"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[Unit]
Description=Kata Agent
BindsTo=netns@podns.service
Wants=process-user-data.service
After=netns@podns.service process-user-data.service
Wants=process-user-data-update.service
After=netns@podns.service process-user-data-update.service
Copy link
Collaborator

Choose a reason for hiding this comment

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

regarding the idea discussed in #1852 (comment), could we instead change the logic to provision the agent-config.file via cloud-config entry, so we don't have to perform any "updates"?


[Service]
Environment=CDH_CONFIG_PATH=/run/confidential-containers/cdh.toml
ExecStartPre=mkdir -p /run/kata-containers
ExecStart=/usr/local/bin/kata-agent --config /etc/agent-config.toml
ExecStart=/usr/local/bin/kata-agent --config /run/peerpod/agent-config.toml
ExecStartPre=-umount /sys/fs/cgroup/misc
ExecStopPost=/usr/local/bin/kata-agent-clean --config /etc/agent-config.toml
ExecStopPost=/usr/local/bin/kata-agent-clean --config /run/peerpod/agent-config.toml
# Now specified in the agent-config.toml Environment="KATA_AGENT_SERVER_ADDR=unix:///run/kata-containers/agent.sock"
SyslogIdentifier=kata-agent

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One-shot systemd service for running the process-user-data binary
# It must run before kata-agent.service

[Unit]
Description=Process user data and provision
After=network.target
DefaultDependencies=no


[Service]
Type=oneshot
ExecStart=/usr/local/bin/process-user-data provision-files
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# It must run before kata-agent.service

[Unit]
Description=Process user data
After=network.target
Description=Process user data and update
After=network.target cloud-final.service process-user-data-provision
DefaultDependencies=no


[Service]
Type=oneshot
ExecStartPre=/usr/local/bin/process-user-data provision-files
ExecStart=/usr/local/bin/process-user-data update-agent-config
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
PartOf=process-user-data-provision.service
Loading