Skip to content

Allow local repo directories in containerd archives #1263

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

Open
ningziwen opened this issue Dec 23, 2022 · 5 comments
Open

Allow local repo directories in containerd archives #1263

ningziwen opened this issue Dec 23, 2022 · 5 comments

Comments

@ningziwen
Copy link
Contributor

ningziwen commented Dec 23, 2022

Description

Hi. I'd like a feature to allow local repo directories in containerd archives in Lima yaml. This can make a smooth experience of developing nerdctl/containerd/buildkit/others in macOS locally without using remote IDE.

Lima yaml only accepts full nerdctl tar.gz today (I found it untars the tar.gz file here so assumed it. Correct me if I missed anything). Although developers can write scripts to build the tar.gz as workaround, directly filling local repo directories can make the experience better.

Example yaml to help explain the idea. The exact interface is still TBD.

# Override containerd archive
# 🟢 Builtin default: hard-coded URL with hard-coded digest (see the output of `limactl info | jq .defaultTemplate.containerd.archives`)
archives:
- location: "~/Downloads/nerdctl-full-X.Y.Z-linux-amd64.tar.gz"
   arch: "x86_64"
   digest: "sha256:..."
local_repo_directories:
- arch: "x86_64"
  nerdctl_directory: "~/workspace/nerdctl"
  containerd_directory: "~/workspace/containerd"
  buildkit_directory: "~/workspace/buildkit"
  • Will raise error if both archives and local_repo_directories are filled to prevent conflict (Alternative is one can override the other)
  • No need to check digest in local_repo_directories
  • If the directory of any dependency is empty in yaml, it will use the lima default one.

User story:

As a macOS developer, if I want to test my nerdctl changes locally, I can follow these steps:

  1. cd ~/workspace
  2. git clone github.com/containerd/nerdctl
  3. cd nerdctl and make changes
  4. Run lima start with the yaml like this
local_repo_directories:
- arch: "x86_64"
  nerdctl_directory: "~/workspace/nerdctl"
  1. Run lima nerdctl ... to test my change

As a macOS developer, if I want to test my containerd changes locally, I can follow these steps:

  1. cd ~/workspace
  2. git clone github.com/containerd/containerd
  3. cd containerd and make changes
  4. Run lima start with the yaml like this
local_repo_directories:
- arch: "x86_64"
  containerd_directory: "~/workspace/containerd"
  1. Use lima nerdctl ... or log in lima shell to test in other ways with containerd socket

As a macOS developer, if I want to test a large feature that includes the features in both containerd and nerdctl locally, I can follow these steps:

  1. cd ~/workspace
  2. git clone github.com/containerd/containerd
  3. git clone github.com/containerd/nerdctl
  4. cd nerdctl and cd containerd to make changes
  5. Run lima start with the yaml like this
local_repo_directories:
- arch: "x86_64"
  nerdctl_directory: "~/workspace/nerdctl"
  nerdctl_directory: "~/workspace/containerd"
  1. Use lima nerdctl ... to test my change.

I can help the design and implementation if you think this is a proper and useful feature for Lima

@AkihiroSuda
Copy link
Member

What is "local repo"?

@AkihiroSuda
Copy link
Member

If that means rpm/dpkg repos maybe you can just use these PRs

@ningziwen
Copy link
Contributor Author

@AkihiroSuda I meant local source repo. I edited the description that includes 3 user stories. Hope that can help explain it.

@AkihiroSuda
Copy link
Member

Alternative ideas:

  • Mount the local repos and compile the binaries inside the guest
  • Mount the local repos, but cross-compile the binaries with GOOS=linux on macOS, and symlink ln -sf /Users/your/local/repo/_output/nerdctl /usr/local/bin/nerdctl in the guest

@ningziwen
Copy link
Contributor Author

ningziwen commented Dec 24, 2022

Alternative ideas:

  • Mount the local repos and compile the binaries inside the guest
  • Mount the local repos, but cross-compile the binaries with GOOS=linux on macOS, and symlink ln -sf /Users/your/local/repo/_output/nerdctl /usr/local/bin/nerdctl in the guest

For the 3rd user story, it will need developer's additional work to make the multiple changed package work together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants