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 for development purposes #7102

Merged
merged 71 commits into from
Oct 9, 2023
Merged

Add devcontainer for development purposes #7102

merged 71 commits into from
Oct 9, 2023

Conversation

thanodnl
Copy link
Member

@thanodnl thanodnl commented Aug 3, 2023

This change adds a devcontainer configuration to the Citus project. This devcontainer allows for quick generation of isolated development environments, either local on the machine of a developer or in a cloud, like github codepaces.

The devcontainer is updated automatically by github actions when its configuration changes.

For more detailed instructions on how to quickstart the development in a container see CONTRIBUTING.md

FOR THE REVIEWERS: make sure that you open this branch when cloning the devcontainer. This requires not pasting in the github url, but instead go through the wizard step by step. eg. first selecting github, then selecting the repository, lastly selecting the branch.

@thanodnl thanodnl marked this pull request as ready for review August 18, 2023 14:21
@thanodnl thanodnl force-pushed the dev/devcontainer branch 4 times, most recently from c47ce66 to ca64edb Compare August 29, 2023 12:49
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #7102 (0623c64) into main (6d8725e) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 0623c64 differs from pull request most recent head 214bed0. Consider uploading reports for the commit 214bed0 to get more accurate results

@@            Coverage Diff             @@
##             main    #7102      +/-   ##
==========================================
- Coverage   93.23%   93.22%   -0.01%     
==========================================
  Files         275      275              
  Lines       59485    59487       +2     
==========================================
+ Hits        55458    55459       +1     
- Misses       4027     4028       +1     

.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
.devcontainer/Dockerfile Outdated Show resolved Hide resolved
.devcontainer/Dockerfile Outdated Show resolved Hide resolved
.devcontainer/.vscode/Pipfile Outdated Show resolved Hide resolved
.devcontainer/.gdbinit Show resolved Hide resolved
@aykut-bozkurt
Copy link
Contributor

@aytekinar please feel free to review

Copy link
Contributor

@aykut-bozkurt aykut-bozkurt left a comment

Choose a reason for hiding this comment

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

Thanks for great initiative to make it easy to contribute to project!

.devcontainer/.vscode/launch.json Show resolved Hide resolved
src/test/regress/Pipfile Outdated Show resolved Hide resolved
@aykut-bozkurt
Copy link
Contributor

Adding ssh keys from host to container could also help us to run git from terminal. Otherwise, only option is to use UI login and operations.

@thanodnl
Copy link
Member Author

thanodnl commented Sep 8, 2023

Adding ssh keys from host to container could also help us to run git from terminal. Otherwise, only option is to use UI login and operations.

You will want to have a look at https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials#_using-ssh-keys on how to do this. This needs to be done outside of the devcontainer. With ssh-agent running vscode will automatically forward the keys of your machine to the container.

@thanodnl thanodnl force-pushed the dev/devcontainer branch 2 times, most recently from 042cd2b to 1d2dc5d Compare September 21, 2023 10:46
.devcontainer/Dockerfile Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated

To quickly start we suggest splitting your terminal once to have two shells. The left one in the `/workspaces/citus`, the second one changed to `/data`. The left terminal will be used to interact with the project, the right one with a testing cluster.

To get citus installed from source we run `make install -sj8` in the first terminal, adjust `j8` to suite to the number of cores you have available. Once installed you can start a Citus cluster in the second terminal via `citus_dev make citus`. The cluster will run in the background, and can be interacted with via `citus_dev`. To get an overview of the available commands.
Copy link
Contributor

@JelteF JelteF Oct 9, 2023

Choose a reason for hiding this comment

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

Probably nicer to add export MAKEFLAGS="-j $(nproc)" to bashrc/zshrc

Copy link
Contributor

@JelteF JelteF Oct 9, 2023

Choose a reason for hiding this comment

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

Or probably even better. Adding it to our make file: https://stackoverflow.com/a/60413199/2570866

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added it to .bashrc for now, and also use the same ENV for building postgres, to allow for higher parallelism on bigger boxes.

We can later evaluate if adding it to our makefile makes sense, since that's a change outside of the devcontainer scope. I tried to keep this change as isolated from the rest of the codebase as possible to make it easy for rubber stamping.

@thanodnl thanodnl enabled auto-merge (squash) October 9, 2023 13:27
@thanodnl thanodnl merged commit 76fdfa3 into main Oct 9, 2023
104 checks passed
@thanodnl thanodnl deleted the dev/devcontainer branch October 9, 2023 13:37
francisjodi pushed a commit that referenced this pull request Nov 13, 2023
This change adds a devcontainer configuration to the Citus project. This
devcontainer allows for quick generation of isolated development
environments, either local on the machine of a developer or in a cloud,
like github codepaces.

The devcontainer is updated automatically by github actions when its
configuration changes.

For more detailed instructions on how to quickstart the development in a
container see CONTRIBUTING.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants