Skip to content

Conversation

@0x416e746f6e
Copy link
Member

implement scripts for l2 workloads building

@0x416e746f6e 0x416e746f6e force-pushed the trunk/l2 branch 7 times, most recently from 1127cde to dbaeecc Compare November 13, 2025 14:17
Melvillian and others added 5 commits November 13, 2025 14:06
Prior to this commit, env_wrapper's 'setup_lima' command would only work for Linux
because it uses the 'nproc' and 'free' shell commands, which do not exist on Mac.
Now, the script detects the platform and uses the appropriate shell commands
…mands

fix: fix setup_lima when run on a mac
cd "$build_dir"
cp "$config_file" .config
export KBUILD_BUILD_TIMESTAMP="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%s)})"
export KBUILD_BUILD_TIMESTAMP="$(date -u -d @$(git log -1 --pretty=%ct))"
Copy link
Member

Choose a reason for hiding this comment

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

We should probably just hard code it to zero

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe pinning the timestamps to the commit one is a standard practice

mkosi-chroot --chdir "/build/kernel-${KERNEL_VERSION}" make -j "$(nproc 2>/dev/null || echo 2)" bzImage ARCH=x86_64 CONFIG_EFI_STUB=y

echo "# kernel config:"
mkosi-chroot --chdir "/build/kernel-${KERNEL_VERSION}" cat .config
Copy link
Member

Choose a reason for hiding this comment

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

Too verbose

Copy link
Member Author

Choose a reason for hiding this comment

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

this snippet was necessary to understand what's going on with non-reproducible builds of the kernel under ubuntu kernel config.

can be removed now, I guess.

Copy link
Member

Choose a reason for hiding this comment

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

What's the purpose of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

to make sure that /etc/sysconfig directory is always present (vault-agent renders some of the secrets into the envs of the systemd services)

Copy link
Member

Choose a reason for hiding this comment

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

@ilyaluk any idea why this file was moved?

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this in buildernet/l2 stuff at the moment, AFAIU, defer question to @0x416e746f6e

Copy link
Contributor

Choose a reason for hiding this comment

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

They both have their own persistent mounting specifics

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not in use in l2

@@ -0,0 +1,14 @@
rust:
Copy link
Member

Choose a reason for hiding this comment

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

When we just grab rust from debian backports this wont be necessary. I'll take care of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

we would still need a way to pin rust version somehow per image type (backports or not).


BuildPackages=golang
libssl-dev
rustup
Copy link
Member

Choose a reason for hiding this comment

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

Switch to backports rust, I'll take care of this

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, just pls make it possible to use different versions of rust on different image kinds.

#
# rendered by vault-agent/gomplate
#
[[- range ( ( gcp.Meta "attributes/ssh-keys" ) | strings.Split "\n" ) ]]
Copy link
Member

Choose a reason for hiding this comment

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

Isn't allowing ppl to SSH in a security risk?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is.

however this line makes sure that the keys are rendered only on the image built with dev profile. so, we are ok on prod images.

and on dev images, well we already allow anyone with console access in + use predefined root password. I don't think that (secret and non public) ssh keys added by vault-agent are making it any worse security-wise here.


# Limit root filesystem size to 4GB

mkosi-chroot sed -i '1a mount -o remount,size=4G /' /init
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this should be an L2 or op_rbuilder postinst thing, not a GCP postinst thing

Copy link
Member Author

Choose a reason for hiding this comment

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

why?

Copy link
Member

@alexhulbert alexhulbert Nov 26, 2025

Choose a reason for hiding this comment

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

since some images may have filesystems larger than 4GB

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.

4 participants