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

Feature/integrate-dev-container #11

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Js-Brecht
Copy link
Collaborator

Description

Adds a dev container to the SmartOrder repository. This should improve developer experience, by way of the following benefits:

  • Makes the project more portable
  • All the required applications / sdks / utilities and the like will already be set up for the developer
  • Configurations / tooling will be set up automatically
  • Environment will be the uniform across platforms
  • Should help reduce issues with onboarding/setup
    as well as make the tooling universal.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sets up a dev container docker image for cross-platform compatibility and portability of the developer environment
* Added the SHELL environment variable to make pnpm happy
* Removed extraneous dependencies, like perl, python, and zsh
   * If desired, those could be added later
@Js-Brecht Js-Brecht self-assigned this Mar 14, 2024
Copy link
Collaborator

@JoshElias JoshElias left a comment

Choose a reason for hiding this comment

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

Looks cool. I need clarification on a few things before merging. Also, how can I test?

export IN_VSCODE=true;
fi

### Exit early if setup is handled by others
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll need this mechanism explained to me. The difference of running in Docker, Vs Code or neither. Maybe we can get on a call tomorrow?

"settings": {
"terminal.integrated.shell.linux": "/bin/zsh"
},
"extensions": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these all the vs code plugins you're bundling in the container? I thought vs code was still running locally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, not bundling. These are just settings that get loaded when you load the container. This tells vscode to install these extensions (but only in the context of the container).

There's still a few in here I meant to remove, I just noticed...

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's kinda what I meant. Inside the container, vs code is being bundled with all those extensions. I'll read more on Dev Containers but clarification on them is a big part of our call today.

"VSCODE": "true"
},
"mounts": [
"source=${localWorkspaceFolder}/../,target=/workspaces,type=bind,consistency=cached"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this mounting whatever folder contains all your projects?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is the goal, yes. I figure that the parent folder of the SmartOrder project would the one. Alternatively, we could have a different repo host them all, and this stuff would just sit in the top of it. The other 3 could be subrepositories

Copy link
Collaborator

Choose a reason for hiding this comment

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

Extensions need to be duplicated here and in devcontainer.json?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file actually needs to go away

Copy link
Collaborator

@JoshElias JoshElias left a comment

Choose a reason for hiding this comment

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

This is looking better the more I look into it. The Docker configs are very pure and if you had to implement this yourself, you'd want to do things how they are. Looks like a good superset.

@JoshElias
Copy link
Collaborator

JoshElias commented Mar 15, 2024

Getting the following error after trying to use the vs code plugin

Command failed: /opt/microsoft/vscode/code /home/josh/.vscode/extensions/ms-vscode-remote.remote-containers-0.348.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/josh/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-f4221a2b-11d0-42b9-9dda-6fe2e335115e1710521006196 --workspace-folder /home/josh/Projects/SmartOrder --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/josh/Projects/SmartOrder --id-label devcontainer.config_file=/home/josh/Projects/SmartOrder/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/josh/Projects/SmartOrder/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=/run/user/1000/wayland-1,target=/tmp/vscode-wayland-d1403961-b4f1-4763-8d23-d64059369a34.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root

@JoshElias
Copy link
Collaborator

It's asking me to "Install in DevContainer"? Is this why we have a million extensions in our config? Because you use every vs code plugin imaginable?

image

@Js-Brecht
Copy link
Collaborator Author

It's asking me to "Install in DevContainer"? Is this why we have a million extensions in our config? Because you use every vs code plugin imaginable?

image

Lmao, I went in a bit of a tangent with the c# / .net stuff. Thought I would look them over with you and see which, if any, would be helpful

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.

2 participants