GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-102973: add a dev container by brettcannon · Pull Request #102975 · python/cpython

Conversation

@brettcannon

@brettcannon brettcannon commented Mar 23, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Defines a Dockerfile based on Fedora along with common tooling (e.g. various shells people may want to use). It also includes the tooling necessary to do a cross-build for WASI.

Co-authored-by: Dusty Phillips [email protected]

  • Issue: Add a dev container to the repository #102973

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
brettcannon added 18 commits March 20, 2023 18:26
@brettcannon
Create a dev container
b3b399c
On content update, builds `python` and the docs.
@brettcannon
Add WASI to the container file
b030aa3
@brettcannon
Ignore nis for WASI
56f990e
Closes pythonGH-102851
@brettcannon
Add Zephyr extension
95898c6
@brettcannon
Add VS Code settings
6f47138
@brettcannon
Move 4-space tab size to be a general setting
f6a543a
@brettcannon
Add git to the Dockerfile
86bdfbb
@brettcannon
Add the Live Preview extension
5b646f4
@brettcannon
Merge branch 'dev-container' of https://github.com/brettcannon/cpython …
a4b113d
…into dev-container
@brettcannon
Add ports used by the Live Preview extension
5cb4547
@brettcannon
Let Live Preview trigger the notification for the ports
ad6b72a
@brettcannon
Add autoconf syntax highlighting
97de684
@brettcannon
Add the C extension
5fdd0be
@brettcannon
Add settings for the Python extension
ec514ce
The extension itself is left out until the Jupyter soft dependency is dropped to minimize installation cruft for this repo.
@brettcannon
Tweak a comment
a7437ae
@brettcannon
Turn off C error squiggles
73c9bec
Seems to not like `Py_VAR_HEAD`.
@brettcannon
Add comments for why an extension is included
473d434
@brettcannon
Install which, zsh, and fish in the dev container
a42cc51
@brettcannon
brettcannon requested review from encukou and vstinner March 23, 2023 20:27
@bedevere-bot bedevere-bot mentioned this pull request Mar 23, 2023
Add a dev container to the repository #102973
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 23, 2023
@brettcannon
brettcannon removed the request for review from vstinner March 23, 2023 20:32
brettcannon added 3 commits March 23, 2023 13:40
@brettcannon
Merge branch 'main' into dev-container
bd54202
@brettcannon
Add a news entry
4d8d082
@brettcannon
Add blurb to the container
ab50a16
@encukou

encukou commented Mar 24, 2023

Copy link
Copy Markdown
Member

@frenzymadness, do you want to take a look?

(I wont't get to it this week)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frenzymadness

frenzymadness commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

Thanks @encukou for the ping. I like it. You might want to use --setopt=tsflags=nodocs for the dnf command to skip documentation packages (--no-docs should work as well) and then you might want to do dnf -y clean all to remove cached files from the resulting image.

brettcannon reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ronaldoussoren
ronaldoussoren reviewed Mar 26, 2023
View reviewed changes
Comment thread .devcontainer/devcontainer.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

ronaldoussoren
ronaldoussoren reviewed Mar 26, 2023
View reviewed changes
Comment thread Tools/wasm/Setup.local.example Resolved

Uh oh!

There was an error while loading. Please reload this page.

brettcannon and others added 3 commits March 27, 2023 16:12
@brettcannon @ronaldoussoren
Fix a comment typo
8805339
Co-authored-by: Ronald Oussoren <[email protected]>
@brettcannon
Merge branch 'main' into dev-container
5884f0d
@brettcannon
Don't build docs and have dnf clean up after itself
64bd77d
@brettcannon

brettcannon commented Mar 27, 2023

Copy link
Copy Markdown
Member Author

Thanks @frenzymadness ! PTAL and let me know if I got everything you were suggesting.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frenzymadness

frenzymadness commented Mar 28, 2023

Copy link
Copy Markdown
Contributor

Thanks @frenzymadness ! PTAL and let me know if I got everything you were suggesting.

Looks perfect to me now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Mar 28, 2023

Copy link
Copy Markdown
Member

I'm not familiar with devcontainers, let me throw ideas around for consideration.

I don't understand the onCreateCommand. Is in any different from the Dockerfile install section? Installing everything at once could save some repo syncing.

You might want to install ccache to speed up builds, especially after switching branches. The default cache size (5G, AFAIK) might be too much.

You might want to install python3-blurb from RPM, if avoiding yet another tool (pipx) sounds interesting.

There's also a python3-sphinx RPM. With it you could make --directory Doc html without venv to save time. If you want to add it, install with dnf --setopt=install_weak_deps=False to skip dependencies related to image manipulation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Mar 28, 2023

Copy link
Copy Markdown
Member Author

I don't understand the onCreateCommand. Is in any different from the Dockerfile install section? Installing everything at once could save some repo syncing.

It is, but I view the dev container details as specific to editing via GitHub Codespaces while with the Dockerfile I tried to take a less opinionated approach.

You might want to install ccache to speed up builds, especially after switching branches. The default cache size (5G, AFAIK) might be too much.

👍

You might want to install python3-blurb from RPM, if avoiding yet another tool (pipx) sounds interesting.

I'm up for it!

There's also a python3-sphinx RPM. With it you could make --directory Doc html without venv to save time.

With GitHub Codespaces prebuilds the save is minimal since the assumption is everyone will start from the container already created and all of those commands already run (takes less then 45 seconds to get to a terminal prompt). But I'm up for trying it out!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Mar 28, 2023

Copy link
Copy Markdown
Member Author

Turns out python3-sphinx is the wrong Sphinx version and skips installing the theme and other things required to build the docs, so I don't think it's going to improve anything.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brettcannon added 2 commits March 28, 2023 22:44
@brettcannon
Drop pipx for python3-blurb
cc8ac24
@brettcannon
Merge branch 'main' into dev-container
a7d6545
@brettcannon

brettcannon commented Mar 28, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

I decided to not go with ccache to start since it could lead to actual costs for people who might not be aware that ccache is running and upping the amount of storage their Codespace is using while not being required to simply build Python effectively (granted, people get 15GB free every month and USD $0.07/GB after that, but still).

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon
brettcannon merged commit 0b1d9c4 into python:main Mar 29, 2023
@brettcannon
brettcannon deleted the dev-container branch March 29, 2023 20:28
@bedevere-bot bedevere-bot removed the awaiting core review label Mar 29, 2023
@brettcannon

brettcannon commented Mar 29, 2023

Copy link
Copy Markdown
Member Author

I decided to go ahead and merge this as we can easily update it if there's anything we want to tweak.

d4tech, methane, and encukou reacted with hooray emoji
All reactions
  • 🎉 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@methane

methane commented Mar 30, 2023

Copy link
Copy Markdown
Member

It takes 20min to start Codespace.
Could you enable prebuild in this repository?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Mar 30, 2023

Copy link
Copy Markdown
Member Author

It takes 20min to start Codespace. Could you enable prebuild in this repository?

Already working on it; have to get budget from the PSF first.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Mar 31, 2023

Copy link
Copy Markdown
Member

In case you want to revisit ccache (e.g. if juggling branches is a common use case), the cache size can be set with echo 'max_size = 100M' > /etc/ccache.conf

  • I'm assuming the devcontainer script controls system-wide setup (/etc/): user-specific config should go to $HOME/.config/ccache/ccache.conf & Fedora defaults are compiled in
  • A full build takes up ~27M of cache, two very different branches (3.12 and 3.6) fill ~40M.

Turns out python3-sphinx is the wrong Sphinx version and skips installing the theme and other things required to build the docs, so I don't think it's going to improve anything.

Fair. I use it (one less venv → one less update command to forget to run, and with docs previews a slightly outdated version doesn't matter that much), but, it's not for everyone.
But in case it's useful: to install the theme, linkchecker, and other things, there's dnf builddep python3-docs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Mar 31, 2023

Copy link
Copy Markdown
Member Author

In case you want to revisit ccache (e.g. if juggling branches is a common use case), the cache size can be set with echo 'max_size = 100M' > /etc/ccache.conf

Yep, I believe you can also use ccache --max-size, but since that decision could cost people money, I didn't want to make that decision for them.

(one less venv → one less update command to forget to run, and with docs previews a slightly outdated version doesn't matter that much

True, although once we get prebuilds up and running that will be automatic after every commit to main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

Prebuilds have been turned on! https://github.com/python/cpython/actions/workflows/codespaces/create_codespaces_prebuilds

/cc @methane

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hroncok
hroncok reviewed Apr 5, 2023
View reviewed changes
Comment thread .devcontainer/Dockerfile
ENV WASMTIME_VERSION=7.0.0
ENV WASMTIME_CPU_ARCH=x86_64

RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \

@hroncok hroncok Apr 5, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I realize I am late to the party, but you might save space by installing git-core instead of git, which should avoid Perl (unless something else brings it in).
(dnf builddep python3 will bring in git-core as well, because we use git to apply patches, but that is probably not explicit enough.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hroncok hroncok Apr 5, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Invoking dnf with --setopt=install_weak_deps=False will also save space. Let me try sending a PR and see if it works.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hroncok hroncok Apr 5, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

#103283

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@brettcannon @ronaldoussoren
@dusty-phillips @warsaw
pythonGH-102973: add a dev container (pythonGH-102975)
18305dc
On content update, builds `python` and the docs. Also adds a Dockerfile that should include everything but autoconf 2.69 that's necessary to build CPython and the entire stdlib on Fedora.

Co-authored-by: Ronald Oussoren <[email protected]>
Co-authored-by: Dusty Phillips <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ronaldoussoren ronaldoussoren ronaldoussoren left review comments
@encukou encukou Awaiting requested review from encukou
+1 more reviewer
@hroncok hroncok hroncok left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@brettcannon @encukou @frenzymadness @methane @ronaldoussoren @hroncok @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.