Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 20, 2023
1 parent e7ebc9a commit 9dfee02
Showing 1 changed file with 47 additions and 45 deletions.
92 changes: 47 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ The documentation should help configure the BinderHub service to:
4. Create a docker repository for binderhub to push built images to. In this tutorial, we will be using Google Artifact Registry,
but binderhub supports using other registries.

Create a new Artifact Registry ([via this URL](https://console.cloud.google.com/artifacts/create-repo). Make sure you're in the correct project (look at the drop
down in the top bar). If this is the first time you are using Artifact Registry, it may ask you to enable the service.
Create a new Artifact Registry ([via this URL](https://console.cloud.google.com/artifacts/create-repo). Make sure you're in the correct project (look at the drop
down in the top bar). If this is the first time you are using Artifact Registry, it may ask you to enable the service.

In the repository creation page, give it a name (ideally same name you are using for
helm chart), select 'Docker' as the format, 'Standard' as the mode, 'Region'
as the location type and select the same region your kubernetes cluster is in. The
settings about encryption and other options can be left in their default. Hit "Create".
In the repository creation page, give it a name (ideally same name you are using for
helm chart), select 'Docker' as the format, 'Standard' as the mode, 'Region'
as the location type and select the same region your kubernetes cluster is in. The
settings about encryption and other options can be left in their default. Hit "Create".

5. Find the full path of the repository you just created, by opening it in the list
and looking for the small 'copy' icon next to the name of the repository. If you
Expand Down Expand Up @@ -123,54 +123,56 @@ The documentation should help configure the BinderHub service to:
username: "_json_key"
password: |
<json-key-from-service-account>
```
```
where:
````
1. `<repository-path>` is what you copied from step 5.
where:
2. `<json-key-from-service-account>` is the JSON file you downloaded in step 7.
This is a multi-line file - either indent it correctly to match up (the `|`
allows multiline strings),
or simply edit the contents to be a single line. Since it is JSON,
it does not matter.
1. `<repository-path>` is what you copied from step 5.

3. `<region>` is the region your artifact repository was created in. You can see
this in the first part of `<repository-path>` as well.
2. `<json-key-from-service-account>` is the JSON file you downloaded in step 7.
This is a multi-line file - either indent it correctly to match up (the `|`
allows multiline strings),
or simply edit the contents to be a single line. Since it is JSON,
it does not matter.

9. Run a `helm upgrade` to use the new configuration you just created:
3. `<region>` is the region your artifact repository was created in. You can see
this in the first part of `<repository-path>` as well.

```bash
helm upgrade \
--install \
--create-namespace \
--devel \
--wait \
--namespace <namespace>
<name> \
binderhub-service/binderhub-service \
-f binderhub-service-config.yaml
```
9. Run a `helm upgrade` to use the new configuration you just created:

This should set up binderhub with this custom config. If you run a `kubectl -n <namespace> get pod`,
you will see that the binderhub pod has restarted - this confirms that the config has been set up!
```bash
helm upgrade \
--install \
--create-namespace \
--devel \
--wait \
--namespace <namespace>
<name> \
binderhub-service/binderhub-service \
-f binderhub-service-config.yaml
````
This should set up binderhub with this custom config. If you run a `kubectl -n <namespace> get pod`,
you will see that the binderhub pod has restarted - this confirms that the config has been set up!

10. Let's verify that _image building and pushing_ works. Access the binderhub pod by following the
same instructions as step 3. But this time, you should see a binderhub page very similar to that
on [mybinder.org](https://mybinder.org). You can test build a repository here - I recommend trying
out `binder-examples/requirements`. It might take a while to build, but you should be able to see
logs in the UI. It should succeed at _pushing_ the github image, but will fail to launch. The last
lines in the log in the UI should look like:

```
Successfully pushed europe-west10-docker.pkg.dev/binderhub-service-development/bh-service-test/binderbinder-2dexamples-2drequirements-55ab5c:50533eb470ee6c24e872043d30b2fee463d6943fBuilt image, launching...
Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
```
You can also go back to the Google Artifact Registry repository you created earlier to verify that the built
image is indeed there.
same instructions as step 3. But this time, you should see a binderhub page very similar to that
on [mybinder.org](https://mybinder.org). You can test build a repository here - I recommend trying
out `binder-examples/requirements`. It might take a while to build, but you should be able to see
logs in the UI. It should succeed at _pushing_ the github image, but will fail to launch. The last
lines in the log in the UI should look like:

```
Successfully pushed europe-west10-docker.pkg.dev/binderhub-service-development/bh-service-test/binderbinder-2dexamples-2drequirements-55ab5c:50533eb470ee6c24e872043d30b2fee463d6943fBuilt image, launching...
Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
```
You can also go back to the Google Artifact Registry repository you created earlier to verify that the built
image is indeed there.
12. Now that we have verified this is working, we can disable the binderhub UI as we will not be using it.
Remove the `config.BinderHub.enable_api_only_mode` configuration from the binderhub config, and redeploy
Expand Down

0 comments on commit 9dfee02

Please sign in to comment.