ci icon indicating copy to clipboard operation
ci copied to clipboard

Proposal for addition of reference implementation of CLI for GitLab pipelines (request for early feedback)

Open rirl opened this issue 2 years ago • 5 comments

Does a proposal to add CLI implementation for GitLab pipelines make sense at all? Looking for very early feedback before I go any further.

Not even sure at this point what might have to change in the specification, if anything. Goal is to be able to use devcontainer.json to define local inner loop pipeline that align with CI pipelines in GitLab.

Call me crazy....

rirl avatar Aug 08 '22 23:08 rirl

Hi @rirl, thanks for the question! Can you provide more info about what you are trying to accomplish with the CLI and GitLab pipelines? We have some examples in the CLI repo about how to use the CLI in a CI/CD system, which should work in GitLab pipelines as well.

In general, this repo contains the Devcontainer specification including the devcontainer.json file format and details on how any implementing tool should process and run the containerized dev environment. The devcontainers/cli repo is a reference implementation of the specification in this repo. You are welcome to use that implementation or any other implementation.

jkeech avatar Aug 08 '22 23:08 jkeech

We could also transfer this issue to https://github.com/devcontainers/ci - that has an Action that uses the dev container CLI (https://github.com/devcontainers/cli), so it would be a good spot for a reference implementation. There's also an Azure DevOps task in the same spot, so it would be a good place to keep reference implementations and docs for different systems - assuming they can co-locate (since some things may assume they own the entire repository).

//cc @stuartleeks for input

Chuxel avatar Aug 09 '22 14:08 Chuxel

In the early days of https://github.com/devcontainers/ci it manually called the docker CLI to capture some of the common steps that we needed to take to use dev containers in CI (GitHub and Azure DevOps being the two that I spend most time with). When https://github.com/devcontainers/cli was released, I replaced the implementation in https://github.com/devcontainers/ci with calls to this new devcontainer CLI (sometimes referred to as the reference implementation).

So if you're looking to implement something similar in GitLab, the https://github.com/devcontainers/ci repo might be an interesting reference point?

stuartleeks avatar Aug 09 '22 14:08 stuartleeks

Thanks everyone.

My main use-case is to provide a CI/CD inner loop for a specialized set of embedded (proprietary) Linux kernel based systems and associated libraries using Visual Studio Code Remote Development (containers, WSL-2, and ssh).
I have done a fair bit of work at this level. I believe I have a solid grasp on the related aspects. What I have works under VsCode on Windows (docker-desktop; WSL-2), MacOS (docker-desktop), and Linux (docker CE).

The next step is try and integrate this solution and leverage (with probable refactor) an existing GitLab CI/CD pipeline framework which currently implements the CI/CD outer loop.

So given that and all of your feedback it looks like both devcontainers CI and (potentially) devcontainers CLI make sense to look at.

I have floated these ideas this on my personal github and will probably handle the actual work under a 'corporate' GitHub organization. Does this introduce any special considerations?

pac-rirl avatar Aug 09 '22 15:08 pac-rirl

@pac-rirl You'll be asked to sign a contributors license agreement if you haven't already when you make a PR like any other OSS project but beyond that, nope!

I'll transfer this issue to the CI repository for now. We can move it as appropriate from there. Thanks for the interest and input!

Chuxel avatar Aug 10 '22 14:08 Chuxel