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

Create devcontainer.json #3698

Closed
wants to merge 1 commit into from

Conversation

StemmlerSisters
Copy link

No description provided.

@qwerty287
Copy link
Contributor

Hello!
Could you explain why this change is necessary and what it's doing?

@6543
Copy link
Member

6543 commented May 13, 2024

links to some documentation would also be useful

@qwerty287 qwerty287 added the feedback this needs feedback label May 14, 2024
@@ -0,0 +1,5 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer we would use mcr.microsoft.com/devcontainers/go:1.22-bullseye with features required for woodpecker development like ghcr.io/devcontainers/features/node:1 with same node version we use in pipelines etc

@lafriks
Copy link
Contributor

lafriks commented May 14, 2024

Hello! Could you explain why this change is necessary and what it's doing?

This would allow developing woodpecker without needing to install development tools (go, node etc) on your pc, VSCode would detect and ask to switch to devcontainer mode where it starts vscode instance in container that is build based on this file.

More info in https://containers.dev/

Would be nice so that would also allow setting up test gitea instance etc to work with but this is not prerequesite for this PR

@anbraten
Copy link
Member

Would be nice so that would also allow setting up test gitea instance etc to work with but this is not prerequesite for this PR

Would be great to have the same setup as we use for gitpod. Shouldn't be actually to tough to achieve using devcontainers with a docker-compose file.

@6543
Copy link
Member

6543 commented May 14, 2024

can containers use nix flakes?

if so, we can use the flake to maintain the dependencys

@qwerty287
Copy link
Contributor

Do we really need yet another dev environment?
We just had that discussion in #3702.

@lafriks
Copy link
Contributor

lafriks commented May 15, 2024

Do we really need yet another dev environment? We just had that discussion in #3702.

devcontainers are supported out of the box in vscode (github codespaces and other services also use it), it has more compatibility between different tools not like gitpod or nix that works only with specific environment

devcontainers can be used in win/linux/mac and does not depend on any external service like gitpod

@qwerty287
Copy link
Contributor

Sure, it's probably a great tool but we can't just add new config files for every dev env. Even if there are multiple tools supporting it.

If there's one file that is supported by all tools that would be fine, but how it's now we just add new envs.

Does gitpod support devcontainers so we could replace the gitpod config?

@lafriks
Copy link
Contributor

lafriks commented May 15, 2024

Personally I don't use gitpod as I don't see any reason for me to use it (it's external commercial cloud, requires special plugin and registration etc).

Devcontainers can be used in GitHub to do quick development and contributions thus more easy to use:
image

VSCode does not require any external services at all (just VSCode and Docker), have not used but I think IntelliJ also supports devcontainers out of the box.

There are also multiple open source tools that allow to use devcontainers having just docker and this tool installed (ex daytona.io or devpod.sh )

Nix is nice but also requires to have nix/nixos and works only for linux but it's small config so not that it's hard to maintain.

So I would vote for droping gitpod and replacing it with devcontainers

@qwerty287
Copy link
Contributor

So it looks like gitpod does not support devcontainers: gitpod-io/gitpod#7721

So I would vote for droping gitpod and replacing it with devcontainers

I think I agree at this point, still I'm not a big fan of these environment configs.

@6543
Copy link
Member

6543 commented May 16, 2024

Well we can move forwarx with this and remove you custom made 'in_docker' makefile target

# If the first argument is "in_docker"...

Also the related dockerfile to build the dev env can be used here for this ...

@6543
Copy link
Member

6543 commented May 16, 2024

and we could reuse nix: https://github.com/xtruder/nix-devcontainer

@lafriks
Copy link
Contributor

lafriks commented May 17, 2024

and we could reuse nix: https://github.com/xtruder/nix-devcontainer

does not look very standard way to use devcontainers and not sure it works in github codespaces

@6543
Copy link
Member

6543 commented May 20, 2024

Well it either works or the devcontaier prommise is broken

@lafriks
Copy link
Contributor

lafriks commented May 20, 2024

in cloud based environments there could be some problems with specific used mounts/volumes and security options used there

@6543
Copy link
Member

6543 commented May 20, 2024

I'll make a test :)

@anbraten
Copy link
Member

Started some testing here: main...anbraten:woodpecker:dev-container Mainly missing the env var setup

@qwerty287
Copy link
Contributor

I'll close this as the original opener does not respond. If we want to add it please open a new pr

@qwerty287 qwerty287 closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback this needs feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants