jimbaker / tagstr

This repo contains an issue tracker, examples, and early work related to PEP 999: Tag Strings
51 stars 6 forks source link

Add Dockerfiles #39

Closed koxudaxi closed 9 months ago

koxudaxi commented 9 months ago

This PR adds official docker file-based images that build the tag-strings-v2 branch's CPython.

@pauleveritt I can provide the GitHub Action workflow to publish the docker images to DockerHub. My project GitHub Action

pauleveritt commented 9 months ago

Did you have to do anything to get multi-architecture builds? (Took me a while to get that figured out.)

koxudaxi commented 9 months ago

@pauleveritt Did you say about linux/arm64 ? I use Ubuntu on x86-64 and I have to install qemu-user-static to build cross-platform. GitHub Action needs Qemu too.

pauleveritt commented 9 months ago

I mean using Docker's buildx to make images that will work on ARM as well as x86. Here's an article.

I did that for the build I uploaded to Docker Hub.

koxudaxi commented 9 months ago

Yes, we need to run docker buildx build --platform linux/amd64,linux/arm64

It is not clear if it will complete within the CI timeout on the free instance, as it requires a lot of compute power to build. My machine(i7-12700H) spent about 7 min(435sec) to build 'linux/amd64'

koxudaxi commented 9 months ago

@pauleveritt @jimbaker There is the issue of where and how to publish the Dockerfile, but I think the Dockerfile itself is fine, please review this PR.

pauleveritt commented 9 months ago

I'm ok if we don't make it part of CI and just publish manually for now.

Do you want to make a Docker Hub account and put it there?

koxudaxi commented 9 months ago

@pauleveritt I use the organization to share my OSS. https://hub.docker.com/orgs/koxudaxi/

Do we need a new organization for the project? Or, should we re-use my org?

koxudaxi commented 9 months ago

I'm uploading the images to my org https://hub.docker.com/r/koxudaxi/python/tags cross-build needs time on my i7. So, My MacMini M1 is building arm64 images.

gvanrossum commented 9 months ago

It’s not my decision, but why do we need all this in this repo? The OP could just as well create their own GitHub repo. All we would need to do is link there from our README. What am I missing?

pauleveritt commented 9 months ago

It's my fault, I thought we were approaching the point where we wanted to make it easy for people to get started. I'll talk it over with Jim about moving things out.

gvanrossum commented 9 months ago

There isn't even a PEP draft (at least, none that has been submitted as a PR for the peps repo). Isn't that a little early to try and make it easy for people to get started? Honestly, if the Docker files came from you I wouldn't have objected, but I didn't recognize the OP's username, so my security hackles got slightly raised.

pauleveritt commented 9 months ago

Makes sense. We can slow things down a bit. FWIW, you and Koudai met briefly in Japan. He and I are talking about some things to do related to this.

gvanrossum commented 9 months ago

Sorry Koudai! It’s hard to remember everyone’s name. I’m glad you’ve decided to help out with this project.

koxudaxi commented 9 months ago

@gvanrossum

My apologies. you make sense @pauleveritt and I have been emailing back and forth about this frequently lately, but I should have written it in the public space in like the issue or PR detail before creating the PR.

I briefly addressed (~1 minute) at the end of a meetup at the University of Tokyo in Japan last month. I told them that I wanted to contribute to this PEP and that I had built the tag-string-v2 branch in pyodide to work with the wasm version of jupyter, but it was obviously crowded and I didn't explain myself well enough, so it's no wonder I don't remember. https://github.com/koxudaxi/tagstr-playground

This build will be useful for demos and playgrounds, as it requires no installation or server, and the tag string interpreter can be run in the browser alone. We will be able to include it in the documentation when it becomes necessary.

jimbaker commented 9 months ago

@koxudaxi this is amazing, thanks! While I'm happy to see this work for tag strings, it's a really nice way for other proposals - including still pre-PEP tagstr - to readily demonstrate Python language changes.