Skip to content

fix(dogfood/contents): fix resource metadata under nix #16349

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

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

johnstcn
Copy link
Member

No description provided.

@johnstcn johnstcn requested a review from ThomasK33 January 30, 2025 17:04
@johnstcn johnstcn self-assigned this Jan 30, 2025
ThomasK33
ThomasK33 previously approved these changes Jan 30, 2025
@johnstcn johnstcn changed the title fix(dogfood/contents): fix shebang in resource metadata scripts fix(dogfood/contents): fix resource metadata under nix Jan 30, 2025
Change-Id: Ie978c62ce4164386e55cedd6d7ceae71b07e217e
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@johnstcn johnstcn dismissed ThomasK33’s stale review January 30, 2025 21:34

100 layers for me

@johnstcn
Copy link
Member Author

EDIT: I was building .#dev_image instad of .#packages.x86_64-linux.dev_image which resulted in an image with 100 layers. The latter results in 32 layers 👍

@johnstcn
Copy link
Member Author

johnstcn commented Jan 30, 2025

  • Need to add an old-style init script for docker (see /etc/init.d/docker in the regular image) -- we do not need to have systemd actually running looks like
  • Need to set permissions on /var/run/docker.sock
  • Need to install ca-certificates

@ThomasK33 ThomasK33 force-pushed the cj/dogfood-usr-bin-env-bash branch 2 times, most recently from 61d4348 to 387cafb Compare February 3, 2025 20:47
@ThomasK33
Copy link
Member

  • Need to add an old-style init script for docker (see /etc/init.d/docker in the regular image) -- we do not need to have systemd actually running looks like
  • Need to set permissions on /var/run/docker.sock

I added a script in init.d to start the docker daemon with the proper group set up in the background.

  • Need to install ca-certificates

Ca-certificates do get installed, the explicit SSL_CERT_FILE is most likely not getting preserved when running sudo.
We could either change the init script to run a sudo -E service docker start or explicitly add the env variable to the docker start script in the init.d folder. I decided to do the latter.

Copy link
Member Author

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Dockerd starts successfully under sysbox 0.6.6. There's a separate issue with the build scripts:

[nix-shell:~/coder]$ make build
getopt: unrecognized option '--version'
BusyBox v1.36.1 () multi-call binary.

Usage: getopt [OPTIONS] [--] OPTSTRING PARAMS

TIL that busybox has its own slightly different version of getopt 🙃

@ThomasK33 ThomasK33 force-pushed the cj/dogfood-usr-bin-env-bash branch from 387cafb to d52008c Compare February 4, 2025 10:20
@ThomasK33
Copy link
Member

TIL that busybox has its own slightly different version of getopt 🙃

Yep, I removed busybox entirely and pulled in ncurses for clear and su for su.

When running make build the gnu getopt version now gets pulled it from the PATH.

@ThomasK33 ThomasK33 force-pushed the cj/dogfood-usr-bin-env-bash branch from c89b06d to 3bcc415 Compare February 4, 2025 13:38
@johnstcn
Copy link
Member Author

johnstcn commented Feb 4, 2025

make build now working for me. :shipit:

Change-Id: I530de9066ea94ab54488de6e83ed64e7d44a1d72
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the cj/dogfood-usr-bin-env-bash branch from 3bcc415 to b1277e9 Compare February 4, 2025 15:00
@ThomasK33
Copy link
Member

I'll go ahead and merge this PR.

I will need to make a follow-up PR, as we have some tests depending on hard-coded OS values (mostly clistat package relying on Elastic's library, which in turn expects OS information in /etc), and some pty tests failing because they are unable to find env and grep binaries in the $PATH.

@ThomasK33 ThomasK33 merged commit 6b3e14f into main Feb 4, 2025
28 checks passed
@ThomasK33 ThomasK33 deleted the cj/dogfood-usr-bin-env-bash branch February 4, 2025 15:10
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants