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

[WIP][CI:DOCS]Add DevContainers Documentation #18679

Conversation

jakecorrenti
Copy link
Member

@jakecorrenti jakecorrenti commented May 24, 2023

Added documentation for setting up DevContainers in Visual Studio Code using Podman instead of Docker.

Adapted from the work done in #15254

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none labels May 24, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 24, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jakecorrenti
Once this PR has been reviewed and has the lgtm label, please assign giuseppe for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jakecorrenti
Copy link
Member Author

Basic use cases are reproducible. However, I need to iron out some edge cases with more complex use cases.

}
```

`Dockerfile`
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming it has to be a Dockerfile vs a Containerfile

Copy link
Member Author

Choose a reason for hiding this comment

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

confirmed that Containerfile does work

@TomSweeneyRedHat
Copy link
Member

Just a quick late day review, and it looks really good overall. It would be awesome of you could walk through this in a Gmeet, save the recording, then give me a ptr to it so I could put it up on the YouTube channel.

@jakecorrenti
Copy link
Member Author

I could definitely put that together for you

@fulldecent
Copy link
Contributor

I followed along on a M1 MacBook Pro. I kept the uid=1000 part and did not know if I needed to change that.

Also I needed to add a podman machine start.

End result is this error:

Screenshot 2023-05-24 at 19 30 49

Added documentation for setting up DevContainers in Visual Studio Code
using Podman instead of Docker.

Signed-off-by: Jake Correnti <[email protected]>
@fulldecent
Copy link
Contributor

I see the instructions are updated. I followed them, instead using my actual user name instead of $USER in the env variable.

Now got further to this error message:

[62455 ms] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/linux-arm64/b3e4e68a0bc097f0ae7907b217c1119af9e03435' '/root/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435'
[62473 ms] 
[62473 ms] mkdir: cannot create directory ‘/root’: Permission denied
[62473 ms] Exit code 1
[62475 ms] Command in container failed: mkdir -p '/root/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/linux-arm64/b3e4e68a0bc097f0ae7907b217c1119af9e03435' '/root/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435'
[62475 ms] mkdir: cannot create directory ‘/root’: Permission denied
[62475 ms] Exit code 1

@jakecorrenti
Copy link
Member Author

@fulldecent what Image did you select? And what does your devcontainer.json file look like

@fulldecent
Copy link
Contributor

@jakecorrenti I used the Ubuntu image.

And here is the file

// Documentation:
//  - https://github.com/devcontainers/images/tree/main/src/jekyll
//  - https://github.com/devcontainers/features/tree/main/src/node
//  - https://github.com/devcontainers/features/tree/main/src/php

// Issue: how to remove the github.copilot dependency?
// https://stackoverflow.com/questions/76037936/how-to-load-github-copilot-without-specifying-in-devcontainer-json
{
    "name": "Jekyll",
    "image": "mcr.microsoft.com/devcontainers/jekyll",
    "features": {
      // Install latest stable Node (we use for validation scripts after build)
      "ghcr.io/devcontainers/features/node:1": {
        "version": "lts"
      }
    },
    "customizations": {
      "vscode": {
        "extensions": ["github.copilot", "html-validate.vscode-html-validate"]
      }
    }
}

@jakecorrenti
Copy link
Member Author

@jakecorrenti I used the Ubuntu image.

And here is the file

// Documentation:
//  - https://github.com/devcontainers/images/tree/main/src/jekyll
//  - https://github.com/devcontainers/features/tree/main/src/node
//  - https://github.com/devcontainers/features/tree/main/src/php

// Issue: how to remove the github.copilot dependency?
// https://stackoverflow.com/questions/76037936/how-to-load-github-copilot-without-specifying-in-devcontainer-json
{
    "name": "Jekyll",
    "image": "mcr.microsoft.com/devcontainers/jekyll",
    "features": {
      // Install latest stable Node (we use for validation scripts after build)
      "ghcr.io/devcontainers/features/node:1": {
        "version": "lts"
      }
    },
    "customizations": {
      "vscode": {
        "extensions": ["github.copilot", "html-validate.vscode-html-validate"]
      }
    }
}

Using the "features" functionality is known to lead to bugs (#17313). Investigating.

@github-actions
Copy link

github-actions bot commented Jul 1, 2023

A friendly reminder that this PR had no activity for 30 days.

@vrothberg
Copy link
Member

Closing the PR due to inactivity. Feel free to reopen.

@vrothberg vrothberg closed this Oct 18, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none stale-pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants