Skip to content
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

Radius CLI as Devcontainer feature #6906

Closed
Tracked by #30
lechnerc77 opened this issue Dec 3, 2023 · 9 comments · Fixed by #6930
Closed
Tracked by #30

Radius CLI as Devcontainer feature #6906

lechnerc77 opened this issue Dec 3, 2023 · 9 comments · Fixed by #6930
Assignees
Labels
feature This issue describes a feature request in Radius triaged This issue has been reviewed and triaged

Comments

@lechnerc77
Copy link
Contributor

lechnerc77 commented Dec 3, 2023

Overview of feature request

Proivde the Radius CLI as a devcontainer feature (see https://containers.dev/features) to make the provisioning of a devcontainer environment easier.

Acceptance criteria

The radius CLI is available as devcontainer feature in the official and community-supported devcontainer feature page (<https://containers.dev/features>) and can be used within dev containers via the feature section

Additional context

Happy to suport on this topic

AB#10644

@lechnerc77 lechnerc77 added the feature This issue describes a feature request in Radius label Dec 3, 2023
@radius-triage-bot
Copy link

👋 @lechnerc77 Thanks for filing this feature request.

A project maintainer will review this feature request and get back to you soon.

We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.

For more information on our triage process please visit our triage overview

@lechnerc77
Copy link
Contributor Author

I played around a bit to validate the necessary steps. You find the result in my repository including the setup for testing and publishing the dev container feature: https://github.com/lechnerc77/radius-cli-feature

A sample setup is given in https://github.com/lechnerc77/radius-cli-feature/tree/main/.devcontainer/devcontainer-radcli-sample.

I also tried to transfer the setup given in the tutorial-codespace devcontainer to a feature-based setup: https://github.com/lechnerc77/radius-cli-feature/blob/main/.devcontainer/devcontainer-radius-tutorial/devcontainer.json. I think that improves the readability (but maybe I am biased ;-) )

@vinayada1
Copy link
Contributor

Hi @lechnerc77. Thanks for suggesting this improvement. We will look into this shortly.

@lechnerc77
Copy link
Contributor Author

lechnerc77 commented Dec 5, 2023

Hi @vinayada1, let me know if I should create a draft PR with the feature integrated in your setup to get a better idea how it can look like in your project setup.

@rynowak
Copy link
Contributor

rynowak commented Dec 6, 2023

@lechnerc77 - this would be awesome if you want to take it on. Is the right thing for us to do to copy https://github.com/devcontainers/feature-starter into our org?

I can get that set up for you if you want to help.

@lechnerc77
Copy link
Contributor Author

The repository I referenced already anticipated the move into your repository. Expect a first PR soon :-)

@lechnerc77
Copy link
Contributor Author

@rynowak : here is the first version of the PR #6930. Looking forward to your feedback

@shalabhms shalabhms added the triaged This issue has been reviewed and triaged label Dec 7, 2023
@radius-triage-bot
Copy link

👍 We've reviewed this issue and have agreed to add it to our backlog. Please subscribe to this issue for notifications, we'll provide updates when we pick it up.

We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.

For more information on our triage process please visit our triage overview

rynowak added a commit that referenced this issue Dec 12, 2023
# Description

This PR introduces the setup to provision the `radcli` as a devcontainer
feature. This comprises the basic feature setup in package `ext` as well
as the relevant GitHub Action workflows to validate the feature schema,
to test the feature and to publish the feature in the GH packages of the
repository.

Points to discuss/for the review:

- Is location of sources in line with the project guidelines?
- Is workflow for validation really needed?

Not part of PR: To make the feature "officially"available it needs to be
registered on the devcontainer feature page
https://containers.dev/features. This shoudl probably be done by the
Radius maintainers once this PR is merged.

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request adds or changes features of Radius and has an
approved issue (issue link required).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #6906 

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at f2eb71c</samp>

### Summary
🚀🧪🛠️

<!--
1. 🚀 - This emoji represents the new GitHub workflow to release dev
container features to the devcontainers registry. The emoji conveys the
idea of launching or deploying something new and exciting.
2. 🧪 - This emoji represents the new GitHub workflow to test dev
container features using the devcontainer CLI. The emoji conveys the
idea of experimenting or testing something in a controlled environment.
3. 🛠️ - This emoji represents the new files and scripts added for the
Radius CLI feature. The emoji conveys the idea of building or fixing
something with tools.
-->
This pull request adds a new dev container feature for the Radius CLI
and the necessary workflows to test, validate, and release it. The
feature allows users to install and use the Radius CLI in their dev
containers with different versions. The workflows use the devcontainers
action and the devcontainer CLI to automate the feature lifecycle. The
pull request also includes documentation and test scripts for the
feature.

> _`devcontainer` features_
> _GitHub workflows to test, deploy_
> _Autumn leaves falling_

### Walkthrough
* Add and configure three GitHub workflows to test, validate, and
release dev container features
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-786e5036d5206693ef00172e6655e7b814833b8a1117ffed490dd9178f7e2d77R1-R31),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-69fccd49f34279d7919fb3ee4f0b661cc4cf710d4f3e909dad216144513685c4R1-R60),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-61a939772971878380ce0f0fec78dcff2159a3db38a1642817be0e426c28716bR1-R21))
* The `devcontainer-feature-release.yaml` workflow publishes the
features from the `ext/devcontainer/src` directory to the devcontainers
registry using the devcontainers action
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-786e5036d5206693ef00172e6655e7b814833b8a1117ffed490dd9178f7e2d77R1-R31))
* The `devcontainer-feature-test.yaml` workflow tests the features
against different base images and scenarios using the devcontainer CLI
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-69fccd49f34279d7919fb3ee4f0b661cc4cf710d4f3e909dad216144513685c4R1-R60))
* The `devcontainer-feature-validate.yaml` workflow validates the
`devcontainer-feature.json` files for each feature using the
devcontainers action
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-61a939772971878380ce0f0fec78dcff2159a3db38a1642817be0e426c28716bR1-R21))
* Add a new dev container feature for the Radius CLI
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-6a82e3d8f4cc1c53e79c9d811863da1c8e6c560eaf5399a69888cf34e3b54e15R1-R29),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-b6696c2316f872901334f316b093d203dcb4052b98d0f049bfa248b83ec31c94L1-R17),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-e79890431f6a5417ac328841d3e716da24216d75bb60bf653cfebf43d3554c28R1-R31),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-948172e104408d7b88023a905d4c9e8536c3ed0e76e01b0b9313f6e5bf431787L1-R12),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-cc69f6dfc7cf74da17d60297adb1fe30c66e7eb990266c9fa3b9b7ca21d6b889L1-R9),
[link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-4e7f6e849ae923ba58b75122a7d76b9ae78fee0735d4fe083ee463efc6772510L1-R13))
* The `devcontainer-feature.json` file defines the name, id, version,
description, documentationURL, and options of the feature
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-b6696c2316f872901334f316b093d203dcb4052b98d0f049bfa248b83ec31c94L1-R17))
* The `install.sh` file installs the Radius CLI and its dependencies on
the dev container
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-e79890431f6a5417ac328841d3e716da24216d75bb60bf653cfebf43d3554c28R1-R31))
* The `README.md` file provides a brief description, example usage, and
a table of options for the feature
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-6a82e3d8f4cc1c53e79c9d811863da1c8e6c560eaf5399a69888cf34e3b54e15R1-R29))
* The `test.sh` file tests the feature for the default or autogenerated
scenarios using the `dev-container-features-test-lib` library
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-4e7f6e849ae923ba58b75122a7d76b9ae78fee0735d4fe083ee463efc6772510L1-R13))
* The `edge.sh` file tests the feature when the `version` option is set
to `edge` using the same library
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-948172e104408d7b88023a905d4c9e8536c3ed0e76e01b0b9313f6e5bf431787L1-R12))
* The `scenarios.json` file defines a scenario named `edge` that uses
the `mcr.microsoft.com/devcontainers/base:ubuntu` image and sets the
`version` option to `edge` for the feature
([link](https://github.com/radius-project/radius/pull/6930/files?diff=unified&w=0#diff-cc69f6dfc7cf74da17d60297adb1fe30c66e7eb990266c9fa3b9b7ca21d6b889L1-R9))

---------

Signed-off-by: lechnerc77 <[email protected]>
Signed-off-by: Christian Lechner <[email protected]>
Co-authored-by: Ryan Nowak <[email protected]>
@rynowak
Copy link
Contributor

rynowak commented Dec 12, 2023

Thanks @lechnerc77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue describes a feature request in Radius triaged This issue has been reviewed and triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants