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 configs for sagemath/sagemath and sagemathinc/sagemath-core, add Docker section to installation manual #37029

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

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Jan 7, 2024

In https://groups.google.com/g/sage-announce/c/z83jqg9oQJE/m/4iePjwNvAQAJ, @williamstein announced the availability of https://hub.docker.com/r/sagemathinc/sagemath-core
Here we add a devcontainer configuration for it, based on the existing configuration for cocalc.

Likewise we add devcontainer configurations for the project's official Docker images (sagemath/sagemath:latest and :develop). We also update the README regarding the available tags.

New Docker section in the installation guide:

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Jan 7, 2024
@williamstein
Copy link
Contributor

Are there any specific assumptions here about my docker container that I should be aware of and document? Thanks.

@mkoeppe mkoeppe changed the title .devcontainer/downstream-docker-sagemathinc-sagemath-core Add devcontainer config for sagemathinc/sagemath-core, add Docker section to installation manual Jan 7, 2024
@williamstein
Copy link
Contributor

Thanks. I've added a README here to at least reduce the chances we break things upstream: https://github.com/sagemathinc/cocalc-compute-docker/tree/main/src/sagemath/core

@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch 2 times, most recently from 5a2cb2a to 1d3e82f Compare January 22, 2024 00:55
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 1d3e82f to 59e38c9 Compare February 2, 2024 23:40
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 59e38c9 to c4f88d4 Compare February 14, 2024 00:41
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from c4f88d4 to 67c0f63 Compare February 25, 2024 18:29
@mkoeppe mkoeppe requested a review from soehms February 26, 2024 17:13
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 67c0f63 to 2e6bcfd Compare March 3, 2024 22:21
@mkoeppe mkoeppe changed the title Add devcontainer config for sagemathinc/sagemath-core, add Docker section to installation manual Add devcontainer configs for sagemath/sagemath and sagemathinc/sagemath-core, add Docker section to installation manual Mar 4, 2024
@mkoeppe mkoeppe added this to the sage-10.3 milestone Mar 4, 2024
@mkoeppe mkoeppe requested a review from kcrisman March 4, 2024 00:12
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 86bf279 to 9d95d06 Compare March 5, 2024 02:50
@soehms
Copy link
Member

soehms commented Mar 12, 2024

I already asked a similar question in #37304 (see #37304 (comment)):

Is there anything wrong with pointing to our CI images on ghcr.io as another option?

This would give another chance to users who fail with some technical details in any of the Docker images (as in the case of the issue above).

@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 9d95d06 to 2131fad Compare March 14, 2024 07:36
@mkoeppe mkoeppe removed this from the sage-10.3 milestone Mar 20, 2024
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 2131fad to 7c6a91d Compare March 26, 2024 02:01
Copy link

github-actions bot commented Mar 27, 2024

Documentation preview for this PR (built with commit 3b49938; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@soehms
Copy link
Member

soehms commented Mar 28, 2024

Doesn't it make sense to add the new devcontainers downstream-docker-sagemath-sagemath and downstream-docker-sagemath-sagemath-develop to portability_testing.rst, as well?

I've tried to test the new devcontainer.json files on Windows. But you should know that I don't have much experiences with VS Code (nor other modern IDE's) since I still prefere to work in a bash terminal editing with vi where I can always scroll up to see what I did before in correct chronolgy. Maybe that's because my brain is like a sieve and the gaps in it get bigger as I get older. Thus, I don't like that the IDE's constantly erase my traces (and if they are not erased they are diffucult to find).

Anyway, after long and hard experimentation following the instructions I found in #37534 I was able to obtain a working container in a local Windows folder with the new devcontainer.json-files. But in all cases I had to replace the onCreateCommand (I replaced it in all cases by sage which opened sage imediately after creating the terminal in the container). Without that change I got errors not only for the new devcontainer files but also in the computop case. I think the error is caused by a subfolder of a Samba-drive (V:) which occurs in the path variable of the system:

[1138 ms] <3>WSL (841) ERROR: UtilTranslatePathList:2866: Failed to translate V:\Environ

BTW: On the Windows systems to which I have access there is Snagit installed (due to the fact that the snipping-tool that comes with Windows isn't really useful). Many of the VS Code keyboard shortcuts are overlaid by Snagit functionality, for example Ctrl+Shift+P or Ctrl+Shift+X. It took me some time to find out that the command palette is just the input box in the top middle where the input has to start with >. Thus, I would suggest to explain this more explicitly in our documentation concering VS Code.

@kwankyu
Copy link
Collaborator

kwankyu commented May 1, 2024

sagemath/sagemath:develop devcontainer does not work for me. I get

This codespace is currently running in recovery mode due to a container error.
1. Use Cmd/Ctrl + Shift + P -> "Codespaces: View Creation Log" to see full logs
2. Update your devcontainer configuration as needed
3. Use Cmd/Ctrl + Shift + P -> "Codespaces: Rebuild Container" to retry
4. For help, read more about custom configuration: https://aka.ms/ghcs-custom-configuration
mkdir: cannot create directory ‘/home/sage’: Permission denied
codespaces-87b8a4:/workspaces/sage$ touch: cannot touch '/home/sage/.config/vscode-dev-containers/first-run-notice-already-displayed': No such file or directory

I tried it in codespaces.

// * Otherwise, it does nothing. This is so that users can copy this devcontainer.json file as is
// into their projects.
"updateContentCommand": "if [ -d pkgs/sagemath-standard ]; then make configure && ./configure --prefix=/home/sage/sage/local --with-sage-venv; else echo 'Edit .devcontainer/devcontainer.json (updateContentCommand) to run project-specific startup commands'; fi",
"extensions": [
Copy link
Collaborator

@kwankyu kwankyu May 1, 2024

Choose a reason for hiding this comment

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

--prefix=/usr/local/sage/local ?

@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 7c6a91d to 06b677b Compare May 25, 2024 18:22
@mkoeppe mkoeppe force-pushed the devcontainer-downstream-sagemathinc-sagemath-core branch from 06b677b to 3b49938 Compare August 3, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants