binderhub icon indicating copy to clipboard operation
binderhub copied to clipboard

Add AWS ECR support (round two)

Open ivan-gomes opened this issue 5 years ago • 38 comments

Closes https://github.com/jupyterhub/binderhub/issues/705 and follow-on/alternative to https://github.com/jupyterhub/binderhub/pull/920.

Includes updated user documentation on how to configure AWS IAM and BinderHub to use AWS ECR as the Docker registry. Modifications are additive, in that existing configurations should not be affected, and have been tested with ECR.

ivan-gomes avatar Feb 09 '20 04:02 ivan-gomes

Cc @scottyhq

jhamman avatar Feb 10 '20 16:02 jhamman

Thanks for this PR.

Has someone been running this code on AWS?

Having different registry classes is a good idea. Could also be used for GitLab like registries (xref #986 #965)

betatim avatar Feb 13 '20 06:02 betatim

Yes we are running this code on AWS with ECR and no further modifications.

ivan-gomes avatar Feb 13 '20 06:02 ivan-gomes

Hi guys,

Any news about this PR? This is the missing point to me to adopt binderhub as my private notebooks provisioning pipeline.

Can I help in anything?

Best regards, Clovis Chedid

clovischedid avatar May 18 '20 13:05 clovischedid

Hi @clovischedid! Thanks for your interest and offer. I went ahead and responded to all the conversations and applied the naming change requested. I have also re-requested a review from @betatim. Hopefully it's up to snuff now. Otherwise I will try to be quicker on the iteration this time around. :)

ivan-gomes avatar May 19 '20 01:05 ivan-gomes

Status update: addressed all unresolved review comments. Awaiting re-review. :)

ivan-gomes avatar Jun 06 '20 00:06 ivan-gomes

Nice work!

@clovischedid do you have a moment to give this a spin on your deployment? Our tests in this area aren't mega so the knowledge of "someone actually used this feature and it worked" would be great to have.

betatim avatar Jun 09 '20 12:06 betatim

Hello guys,

I'm sorry for my delay.

@betatim I will do my best, but currently, I do not have a production ready deployment. At this time, I'm focusing myself on make binderhub running with AWS managed Kubernets service EKS. I'm facing some network problems as newer version o EKS do not make bridge network as default. By the way, I will try to make AWS ECR as my container registry, but, could you help me? I can't realize how to make helm deploy binderhub from a github branch instead of published version on helm repo.

Regards, Clovis Chedid

Nice work!

@clovischedid do you have a moment to give this a spin on your deployment? Our tests in this area aren't mega so the knowledge of "someone actually used this feature and it worked" would be great to have.

clovischedid avatar Jun 16 '20 13:06 clovischedid

Hello guys,

I'm sorry for my delay.

@betatim I will do my best, but currently, I do not have a production ready deployment. At this time, I'm focusing myself on make binderhub running with AWS managed Kubernets service EKS. I'm facing some network problems as newer version o EKS do not make bridge network as default. By the way, I will try to make AWS ECR as my container registry, but, could you help me? I can't realize how to make helm deploy binderhub from a github branch instead of published version on helm repo.

Regards, Clovis Chedid

Rebuild the BinderHub image from source and set the image to it with helm, @clovischedid.

I might be able to test this PR in a couple of weeks.

Thanks @ivan-gomes for the work!

chicocvenancio avatar Jun 16 '20 13:06 chicocvenancio

@clovischedid @chicocvenancio just checking in if you had a chance to test yet, no pressure.

ivan-gomes avatar Jun 29 '20 18:06 ivan-gomes

@betatim do you think it would be a good idea to merge so it would be easier for those interested like @clovischedid to try it out without having to build from source? For what it's worth, I have it deployed as documented with ECR and this addition doesn't affect default behavior. Hoping to avoid merge conflicts with master again.

ivan-gomes avatar Jul 05 '20 03:07 ivan-gomes

I'd be happy to test and report back as well!

zeyaddeeb avatar Jul 22 '20 13:07 zeyaddeeb

@zeyaddeeb that would be fantastic! Please ping me if I can help with or clarify anything.

ivan-gomes avatar Jul 27 '20 16:07 ivan-gomes

It would be great to have someone test drive these instructions. Though given how long they've already been "in flight" it might be easier to merge them and then update them later as we discover things. With it being merged we might get more eyeballs on it.

betatim avatar Jul 28 '20 17:07 betatim

@betatim I totally agree, especially considering we just resolved another round of merge conflicts in documentation.

ivan-gomes avatar Jul 31 '20 17:07 ivan-gomes

I'll be testing this out over the next few days - will report back.

UPDATE: @ivan-gomes / @betatim - ~I got this to work~ (edit: false alarm, still trying) but with a few ammendments/clarifications to the docs. Are you still planning to merge this? I can then make a new PR with my changes.

TomasBeuzen avatar Aug 11 '20 03:08 TomasBeuzen

@TomasBeuzen you can submit a PR to https://github.com/ivan-gomes/binderhub/tree/aws-ecr-support and I can merge it in. If it's minor and easier for you, you can also describe it here and I would be happy to incorporate the feedback into this PR.

ivan-gomes avatar Aug 15 '20 20:08 ivan-gomes

@TomasBeuzen any update for us? Thanks.

ivan-gomes avatar Sep 04 '20 22:09 ivan-gomes

@ivan-gomes - so sorry I've been super busy preparing for the new school year starting (in Canada). This is on my list but probably not for another 2-3 weeks (feel free to proceed without my comments, otherwise I'll update you ASAP).

TomasBeuzen avatar Sep 04 '20 22:09 TomasBeuzen

Totally understand, best of luck!

ivan-gomes avatar Sep 04 '20 22:09 ivan-gomes

Though given how long they've already been "in flight" it might be easier to merge them and then update them later as we discover things. With it being merged we might get more eyeballs on it.

@betatim I think we should go for it.

ivan-gomes avatar Sep 17 '20 19:09 ivan-gomes

Apologies for delays on this, I got this up and running. I just made a PR for a few potentially helpful clarifications to the docs but otherwise thanks for all your work on this!

TomasBeuzen avatar Sep 18 '20 17:09 TomasBeuzen

That's great news @TomasBeuzen! I merged in your helpful changes. Thanks!

ivan-gomes avatar Sep 19 '20 19:09 ivan-gomes

@betatim just wanted to put this back on your radar. Hope you don't mind. :)

ivan-gomes avatar Oct 15 '20 00:10 ivan-gomes

Pinging this as it would be nice to have it merged 🙂 Happy to help in any way I can!

TomasBeuzen avatar Feb 09 '21 22:02 TomasBeuzen

Hi folks, would love to see this functionality if it's still in the roadmap!

btjones-me avatar Apr 28 '21 11:04 btjones-me

I would be happy to re-resolve conflicts once this PR has been tentatively / conditionally approved. :)

ivan-gomes avatar May 02 '21 01:05 ivan-gomes

I think one issue to consider is how to test this. In the short term we can probably ask a few AWS users to test it for real and sign off on it. In the long term how do we ensure we don't inadvertently break it? It looks like the AWS registry works in a completely different way to a standard docker registry, so it's not going to be regularly tested. Do you have any ideas?

manics avatar May 03 '21 21:05 manics

Happy to test and feed back @manics

btjones-me avatar May 13 '21 08:05 btjones-me

Further to my previous comment. I figured out how to test this properly running a dev build of Binderhub in a Docker container by building the Docker images and installing the helm-chart locally (if someone wants to see how I did this, look here https://github.com/teticio/binderhub at the commented out section of bootstrap.sh). I had been following the instructions here https://binderhub.readthedocs.io/en/latest/contribute.html.

I got it to work but I would still recommend to take out the hard-coded references in _patch_docker_secret in registry.py as follows:

        self.kube_client.patch_namespaced_secret(
            self.parent.push_secret, self.parent.build_namespace, {"data": {"config.json": secret_data}}
        )     

You can also ignore my previous comments on the config file, which work as per the instructions when installing.

teticio avatar May 19 '21 12:05 teticio