Skip to content

Conversation

mkoeppe
Copy link
Contributor

@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

@williamstein
Copy link
Contributor

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

@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

@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).

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 ?

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