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

MyBinder still builds the image, rather than pulling it #63

Closed
robertodr opened this issue Mar 29, 2021 · 13 comments
Closed

MyBinder still builds the image, rather than pulling it #63

robertodr opened this issue Mar 29, 2021 · 13 comments
Labels

Comments

@robertodr
Copy link

@robertodr robertodr commented Mar 29, 2021

Hello, thanks for this really nice action!
Not sure whether this is a bug with the action or a bug with my usage of it.
I've used successfully the action in the past, but I am currently unable to make it work properly with this repo: https://github.com/ENCCS/veloxchem-workshop The workflow including the action goes through and the image is uploaded and publicly visible: https://github.com/orgs/ENCCS/packages/container/package/veloxchem-workshop Nevertheless, MyBinder.org will always rebuild it from scratch, so there must be something wrong in my set up.

@robertodr robertodr added the bug label Mar 29, 2021
@welcome
Copy link

@welcome welcome bot commented Mar 29, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Mar 29, 2021

I know that Binder uses repo2docker, which will scan your repository for configuration files that have the following build priority

Just taking a quick look at your repo, it seems like you have other build files in there that will signal to Binder to build, rather than use your image. I'm not sure off hand if there is a way to tell Binder that you want to build off the Dockerfile as the first priority. @choldgraf do you have any ideas for this?

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Mar 29, 2021

Oh my apologies had a slight misunderstanding.

Looks like you are trying to force MyBinder to build an image to force it cache the image. Please keep in mind that if your repo has any additional commits the cache is invalidated. Also, this is subject to MyBinder caching capacity and rules, which could change over time.

This should not be related at all to your image being publicly visible per my understanding. I tagged a friend that have more insight into this.

If you try just using mybinder.org twice in a row to start a notebook (not relying on this Action) does it build each time?

@choldgraf
Copy link
Member

@choldgraf choldgraf commented Mar 29, 2021

Yep - binder will rebuild the image based on the commit hash, so if you're changing the repo at all, a new build will trigger even if you're not changing a configuration file

@robertodr
Copy link
Author

@robertodr robertodr commented Mar 30, 2021

I see. I am re-running this action on every commit though. So if I wait for the Docker image to be uploaded before launching binder, shouldn't I see an almost instant startup?

@choldgraf
Copy link
Member

@choldgraf choldgraf commented Mar 30, 2021

hmmm - so the repo2docker action just builds an image and pushes it to a repository, it doesn't do anything with Binder specifically. You'd need to configure a Binder repository that pulls from wherever repo2docker-action is pushing, and leave that static so that Binder doesn't re-build it each time.

@robertodr
Copy link
Author

@robertodr robertodr commented Mar 30, 2021

Just to check whether I understand your last comment correctly:

  1. I can have a separate branch/repo with environment.yml and the action pushing to a package repository.
  2. The main branch has a binder/Dockerfile whose only content is the line FROM repo/package:latest.

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Mar 30, 2021

@choldgraf @robertodr no actually this Action does have the ability to cache builds directly to MyBinder.org however, if the action ends up creating commit for you then that cache will be invalidated immediately.

I see that you were using the wrong flag previously and you were supposed to use MYBINDERORG_CACHE ENCCS/veloxchem-workshop@eeb4832#diff-3f922dcd4f5c4cc190cda1ceef3c699d6267fbf980f1bb8c5dfceebaec9db038

Does it work now?

@robertodr
Copy link
Author

@robertodr robertodr commented Mar 30, 2021

Is it MYBINDERORG_CACHE or BINDER_CACHE together with MYBINDERORG_TAG? It looks like it's working now, but it's most likely because I've started the notebooks a couple of times in short succession 🤦

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Mar 30, 2021

@robertodr I would go with this example from the README, sorry meant TAG not CACHE

image

@choldgraf
Copy link
Member

@choldgraf choldgraf commented Mar 30, 2021

@hamelsmu wow this action is cooler than I remembered 😄

@robertodr
Copy link
Author

@robertodr robertodr commented Mar 30, 2021

Wow, yes, I feel quite silly now... I think I tried to get it to push the image to GHCR and expected it to use in on MyBinder.org automagically. Then tried to fix that and got the option names mixed up 🤦

As an aside, the attempt with BINDER_CACHE did work too. However, the specific repo I am working with uses LFS to store the notebooks and they would not be checked out properly.

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Mar 31, 2021

ok great! I'll close this issue then. This was also a good refresher for me as I haven't looked at this repo in some time.

@hamelsmu hamelsmu closed this Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants