Skip to content

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

Merged
ThomasK33 merged 3 commits into
mainfrom
cj/dogfood-usr-bin-env-bash
Feb 4, 2025
Merged

fix(dogfood/contents): fix resource metadata under nix#16349
ThomasK33 merged 3 commits into
mainfrom
cj/dogfood-usr-bin-env-bash

Conversation

@johnstcn

Copy link
Copy Markdown
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
Copy Markdown
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

johnstcn commented Jan 30, 2025

Copy link
Copy Markdown
Member Author
  • 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
Copy Markdown
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.

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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

johnstcn commented Feb 4, 2025

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
@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