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

Add devcontainer config for developing Gitea #24781

Merged
merged 8 commits into from
Jun 16, 2023

Conversation

techknowlogick
Copy link
Member

With the recent release of https://github.com/loft-sh/devpod making ephemeral dev environments (ala GitPod/Codespaces) much easier (aka, no pre-configured infra required). This allows an alternative to using GitPod for such development options.

@techknowlogick techknowlogick added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels May 18, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 18, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 18, 2023
@yardenshoham
Copy link
Member

In Gitpod we also write an app.ini and run make watch. I wonder if that's possible here, could also go in a future PR

@silverwind
Copy link
Member

Where is the start command?

@silverwind
Copy link
Member

silverwind commented May 18, 2023

Also, please re-format this file to 2-space indent.

@techknowlogick
Copy link
Member Author

Also, please re-format this file to 2-space indent.

updated formatting.

Where is the start command?

none yet.

@yardenshoham
Copy link
Member

I tried spinning up a GitHub Codespace but it failed, log:

###########                                                               15.4%2023-05-18 14:56:47.682Z: 
###########                                                               15.5%2023-05-18 14:56:48.734Z: 
###########                                                               15.6%2023-05-18 14:57:27.621Z: 
###########                                                               15.7%curl: (18) transfer closed with 21098780 bytes remaining to read
#17 122.9 
#17 122.9 Binary download from https://nodejs.org/dist/v20.2.0/node-v20.2.0-linux-x64.tar.xz failed, trying source.
#17 122.9 grep: /usr/local/share/nvm/.cache/bin/node-v20.2.0-linux-x64/node-v20.2.0-linux-x64.tar.xz: No such file or directory
#17 122.9 Provided file to checksum does not exist.
#17 122.9 Binary download failed, trying source.
#17 122.9 Detected that you have 2 CPU core(s)
2023-05-18 14:57:27.771Z: #17 122.9 Number of CPU core(s) less than or equal to 2, running in single-threaded mode
2023-05-18 14:57:27.922Z: #17 123.1 Downloading https://nodejs.org/dist/v20.2.0/node-v20.2.0.tar.xz...
2023-05-18 14:57:28.224Z: #17 123.4 #=#=#                                                                         
curl: (22) The requested URL returned error: 500 
#17 123.4 
#17 123.4 Binary download from https://nodejs.org/dist/v20.2.0/node-v20.2.0.tar.xz failed, trying source.
#17 123.4 grep: /usr/local/share/nvm/.cache/src/node-v20.2.0/node-v20.2.0.tar.xz: No such file or directory
#17 123.4 Provided file to checksum does not exist.
#17 123.4 ERROR: Feature "Node.js (via nvm), yarn and pnpm" (ghcr.io/devcontainers/features/node) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/node for help troubleshooting this error.
2023-05-18 14:57:28.243Z: {"outcome":"error","message":"Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.41.0-1684421683984 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1.20 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-gitea-e34ec3f68ee66efeb08de38b5a53c8c0e83bc2a9a5802233221d193ce35354ef-features -f /tmp/devcontainercli-root/container-features/0.41.0-1684421683984/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder","description":"An error occurred setting up the container."}
2023-05-18 14:57:28.249Z: #17 ERROR: executor failed running [/bin/sh -c cp -ar /tmp/build-features-src/node_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/node_1  && cd /tmp/dev-container-features/node_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/node_1]: exit code: 1

#9 [internal] load metadata for mcr.microsoft.com/devcontainers/go:1.20
------
 > [dev_containers_target_stage 5/5] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=node_1,target=/tmp/build-features-src/node_1     cp -ar /tmp/build-features-src/node_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/node_1  && cd /tmp/dev-container-features/node_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/node_1:
#17 122.9 Binary download failed, trying source.
#17 122.9 Detected that you have 2 CPU core(s)
#17 122.9 Number of CPU core(s) less than or equal to 2, running in single-threaded mode
#17 123.1 Downloading https://nodejs.org/dist/v20.2.0/node-v20.2.0.tar.xz...
#17 123.4 #=#=#                                                                         
curl: (22) The requested URL returned error: 500 
#17 123.4 
#17 123.4 Binary download from https://nodejs.org/dist/v20.2.0/node-v20.2.0.tar.xz failed, trying source.
#17 123.4 grep: /usr/local/share/nvm/.cache/src/node-v20.2.0/node-v20.2.0.tar.xz: No such file or directory
#17 123.4 Provided file to checksum does not exist.
#17 123.4 ERROR: Feature "Node.js (via nvm), yarn and pnpm" (ghcr.io/devcontainers/features/node) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/node for help troubleshooting this error.
------
ERROR: failed to solve: executor failed running [/bin/sh -c cp -ar /tmp/build-features-src/node_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/node_1  && cd /tmp/dev-container-features/node_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/node_1]: exit code: 1
2023-05-18 14:57:28.252Z: Stop: Run: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.41.0-1684421683984 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1.20 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-gitea-e34ec3f68ee66efeb08de38b5a53c8c0e83bc2a9a5802233221d193ce35354ef-features -f /tmp/devcontainercli-root/container-features/0.41.0-1684421683984/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-05-18 14:57:28.346Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.41.0-1684421683984 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1.20 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-gitea-e34ec3f68ee66efeb08de38b5a53c8c0e83bc2a9a5802233221d193ce35354ef-features -f /tmp/devcontainercli-root/container-features/0.41.0-1684421683984/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-05-18 14:57:28.399Z:     at Ose (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1946:3264)
2023-05-18 14:57:28.406Z:     at nO (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1946:3200)
2023-05-18 14:57:28.410Z:     at processTicksAndRejections (internal/process/task_queues.js:95:5)
2023-05-18 14:57:28.411Z:     at async Yse (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1961:2626)
2023-05-18 14:57:28.413Z:     at async vh (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1961:3741)
2023-05-18 14:57:28.416Z:     at async Eae (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2092:10371)
2023-05-18 14:57:28.419Z:     at async gae (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2092:10112)
2023-05-18 14:57:28.422Z: devcontainer process exited with exit code 1

====================================== ERROR ====================================
2023-05-18 14:57:28.427Z: Failed to create container.
=================================================================================
2023-05-18 14:57:28.429Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.41.0-1684421683984 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1.20 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-gitea-e34ec3f68ee66efeb08de38b5a53c8c0e83bc2a9a5802233221d193ce35354ef-features -f /tmp/devcontainercli-root/container-features/0.41.0-1684421683984/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-05-18 14:57:28.431Z: Error Code: 1302

====================================== ERROR ====================================
2023-05-18 14:57:28.461Z: Container creation failed.
=================================================================================
2023-05-18 14:57:28.461Z: 

===================================== WARNING ===================================
2023-05-18 14:57:28.464Z: Creating recovery container.
=================================================================================

@techknowlogick
Copy link
Member Author

@yardenshoham

curl: (22) The requested URL returned error: 500 

nodejs.org is probably just having a tea break, hopefully it'll be back soon.

Copy link
Member

@yardenshoham yardenshoham left a comment

Choose a reason for hiding this comment

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

It's a good base. Incomplete and we'll iterate. Next steps is auto app.ini creation and make watch.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 18, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 16, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 16, 2023
@techknowlogick techknowlogick merged commit bc51e25 into go-gitea:main Jun 16, 2023
@GiteaBot GiteaBot added this to the 1.21.0 milestone Jun 16, 2023
@techknowlogick techknowlogick deleted the devcontainer branch June 16, 2023 05:13
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 16, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 16, 2023
* giteaofficial/main:
  Show if File is Executable (go-gitea#25287)
  Add devcontainer config for developing Gitea (go-gitea#24781)
  Add link to support page for commercial support (go-gitea#25293)
  Docs about how to generate config for act runner with docker and setup it with docker-compose (go-gitea#25256)
  Fix some UI alignments (go-gitea#25277)
  Remove fomantic inverted variations (go-gitea#25286)
  Fix issue and commit status popup padding (go-gitea#25254)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants