microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.61k stars 275 forks source link

dev container) For arm, odbc requires `FROM --platform=linux/amd64`, but this makes Python fail to load in VSC devcontainer #8690

Closed valhuber closed 1 year ago

valhuber commented 1 year ago

I am using a VSC devcontainer on an M1 Mac to access SQL/Server.

I created this apilogicserver/api_logic_server_arm_x image with odbc, which note includes FROM --platform=linux/amd64for odbc.

This test project illustrates failures to load the VSCode Python extension in devcontainers specifying odbc and arm.

anthonykim1 commented 1 year ago

Hello, Thank you for posting!

Taking a look at your devcontainer.json file, I realized the extension is not in the "appropriate place" in terms of: https://containers.dev/supporting#editors

The extensions that you want installed should be inside customization, and vscode as such: "customizations": { // Configure properties specific to VS Code. "vscode": { // Set default container specific settings.json values on container create. "settings": {}, "extensions": [], } }

Please let me know if this works for you! Thank you

valhuber commented 1 year ago

Hi, @anthonykim1

Thanks much for your prompt reply. I updated my devcontainer.json, but I still am unable to load Python.

Note: the same devcontainer.json (even with the error) loads fine with my non-odbc container (which is the same without the _x: apilogicserver/api_logic_server_arm)

I updated the readme with a bit more info, and added the container startup log to .devcontainer.

Here is what I see:

Screenshot 2023-07-05 at 5 30 05 PM
anthonykim1 commented 1 year ago

Hello @valhuber! Thank you for updating the devcontainer.json.

I took a look at your new devcontainer.json and realized that you might have forgot to put "ms-python.python" inside the extensions section (the bracket next to extensions seems to be empty)

Above was sort of the "template" in which you can list and put all the vscode extensions you wanted the dev container to install. So for example, your customizations section could look like:

"customizations": { "vscode": { "extensions": [ "ms-python.python", "other extensions that you want!", "perhaps more extension" ] } },

valhuber commented 1 year ago

Yes, noticed that too. Was about to fix, will adviseThanks,Val510-703-5909On Jul 6, 2023, at 9:15 AM, Anthony Kim

@anthonykim1

I did make the recommended update, still not loading extension as shown in project readme file.

I noted the following, which may provide a clue... On amd, this devcontainer.json automatically loads Python into the devcontainer. With the old bad syntax, it would request "Load Python" when I ran, which worked fine. In particular, it knew to load Python into container, whereas it's not doing that on arm (again, referring to "with bad syntax" for "extensions": ["ms-python.python"]

@.***> wrote: Hello @valhuber! Thank you for updating the devcontainer.json. I took a look at your new devcontainer.json and realized that you might have forgot to put "ms-python.python" inside the extensions section (the bracket next to extensions seems to be empty) Above was sort of the "template" in which you can list and put all the vscode extensions you wanted the dev container to install. So for example, your customizations section could look like: "customizations": { "vscode": { "extensions": [ "ms-python.python", "other extensions that you want!", "perhaps more extension"

    ]
}

},

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

anthonykim1 commented 1 year ago

Good Afternoon!

I went to: https://github.com/ApiLogicServer/beta and opened your project via codespaces, and the extension seems to be installed just fine.. Screenshot 2023-07-06 at 2 55 34 PM Screenshot 2023-07-06 at 2 55 58 PM

Typing "python" in terminal from your repo also seems to be working fine Screenshot 2023-07-06 at 2 57 38 PM

I believe problem actually may be outside of our python extension at this point. Also I would note that the extensions listed in devcontainer.json can take awhile (minute or two) to run!

Have you only been running dev container via the VS Code dev container extension?

valhuber commented 1 year ago

Yes, I have had good luck on codespaces, but… it’s not arm, right?

The failures I see are in running devcontainers on a local arm machine.

I do think the problem may be outside Python per se, involving arm support and odbc. Note the dockerfile used to build api_logic_server_arm_x

On Thu, Jul 6, 2023 at 3:00 PM Anthony Kim @.***> wrote:

Good Afternoon!

I went to: https://github.com/ApiLogicServer/beta and opened your project via codespaces, and the extension seems to be installed just fine.. [image: Screenshot 2023-07-06 at 2 55 34 PM] https://user-images.githubusercontent.com/62267334/251583969-c16af6af-bd67-446f-b37f-2648c88132f9.png [image: Screenshot 2023-07-06 at 2 55 58 PM] https://user-images.githubusercontent.com/62267334/251584029-5ea8b1f6-8109-47b3-8172-abb938d2a2ab.png

Typing "python" in terminal from your repo also seems to be working fine [image: Screenshot 2023-07-06 at 2 57 38 PM] https://user-images.githubusercontent.com/62267334/251584260-c3c47f0e-d468-4755-bd7b-4eca50b2baea.png

I believe problem actually may be outside of our python extension at this point. Also I would note that the extensions listed in devcontainer.json can take awhile (minute or two) to run!

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-remote-release/issues/8690, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKSG35TQGGZQ5RS6WKDUBDXO4YPLANCNFSM6AAAAAAZ6EJDTY . You are receiving this because you were mentioned.Message ID: @.***>

-- Thanks, Val

510-703-5909 valhuber on skype

anthonykim1 commented 1 year ago

At this point, I also do believe that the errors would lie on either the arm support and odbc support like you have mentioned, potentially VS Code dev container extension when it comes to ARM support? I was hoping the correction of devcontainer.json would fix the problem, but right now with the extension installing in codespaces but not on the VS Code dev container on ARM machine specifically, makes things trickier.

valhuber commented 1 year ago

Any update on this? It's holding up a release I'd like to do...

valhuber commented 1 year ago

After much time, I have resolved this bug. I am not sure whether it was the odbc procedure (which I changed), or something in the docker commands, but I have a multi-platform image that is VSCode compatible, with odbc support.

It was a struggle, so if you want to pass along what I found, I have documented it here.