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

feat: add configuration for Visual Studio Code #3309

Merged
merged 5 commits into from Jan 17, 2022
Merged

Conversation

kichik
Copy link
Contributor

@kichik kichik commented Dec 30, 2021


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kichik
Copy link
Contributor Author

kichik commented Dec 30, 2021

Out of all the different tags I tried, node14 was the only one that worked. I tried latest, 1-buster-slim and a few others.

@RomainMuller
Copy link
Contributor

Out of all the different tags I tried, node14 was the only one that worked. I tried latest, 1-buster-slim and a few others.

The PR has jsii/superchain:1-buster-slim though? What issues did you encounter exactly?

@kichik
Copy link
Contributor Author

kichik commented Jan 12, 2022

Mostly EPERM errors. I also get one when trying to build latest. This is what I used for building from source:

{
    "name": "Dev Container Definition - AWS JSII",
    "build": {
        "dockerfile": "superchain/Dockerfile",
        "context": ".",
        "args": {
            "BUILDPLATFORM": "linux/amd64",
            "TARGETPLATFORM": "linux/amd64",
            "BUILD_TIMESTAMP": "unknown",
            "REGISTRY": "docker.io/library",
            "COMMIT_ID": "head"
        }
    },
    "postCreateCommand": "yarn install && yarn build",
    "extensions": [
        "dbaeumer.vscode-eslint@2.1.5"
    ]
}

@RomainMuller
Copy link
Contributor

Oh EPERM might be because the 1-buster-slim derived images have a non-root USER. I'm not familiar enough with VSCode container environments to know if that matters/can be supported or not...

@@ -0,0 +1,8 @@
{
"name": "Dev Container Definition - AWS JSII",
"image": "jsii/superchain:1-buster-slim",
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand the documentation correctly, adding remoteUser might make EPERM problems go away (ref: https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user).

Suggested change
"image": "jsii/superchain:1-buster-slim",
"image": "jsii/superchain:1-buster-slim",
"remoteUser": "superchain",

This will assure we get the right image for the branch.
Also build faster by ignoring temporary files like python venv and node_modules that the build itself creates.
error An unexpected error occurred: "EPERM: operation not permitted, chmod '/workspaces/jsii/packages/@jsii/dotnet-runtime/node_modules/.bin/jsii-runtime'".
@kichik
Copy link
Contributor Author

kichik commented Jan 12, 2022

Thanks for the push. I was able to finally track down one of the more persistent access denied issues. It was unable to gather Docker context because it was trying to copy the .env folder which was owned by root. That's just a Python virtual environment created as part of the build process. I added it to .dockerignore along with some others as even the test image that copy them doesn't use them.

So I am now finally able to build the container automatically with VScode instead of using an old one that possibly doesn't match. It especially doesn't match because I'm doing all this to get Ruby support in.

But... it still won't install :(
I tried remoteUser, containerUser, and none of it and I still get the following when it runs yarn install:

error An unexpected error occurred: "EPERM: operation not permitted, chmod '/workspaces/jsii/packages/@jsii/dotnet-runtime/node_modules/.bin/jsii-runtime'".

It seems to be a symlink pointing to a file that's part of the repo. That file belongs to root. So I ended up just letting it all run as root and it's finally working end to end.

@mergify
Copy link
Contributor

mergify bot commented Jan 17, 2022

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Jan 17, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 17, 2022

Merging (with squash)...

@mergify mergify bot merged commit 3edf74c into aws:main Jan 17, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 17, 2022

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Jan 17, 2022
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.

None yet

2 participants