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

Auto-generate CRD docs and manifests #78

Merged
merged 6 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ name: Acceptance Tests
on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
- closed
- opened
- edited
- synchronize
- reopened
- closed
workflow_dispatch:

jobs:
acceptance-tests-images:
Expand Down Expand Up @@ -85,7 +86,7 @@ jobs:
pipenv install --dev
cd helm-chart
pipenv run chartpress
kind load docker-image $(pipenv run chartpress --list-images)
kind load docker-image $(pipenv run chartpress --list-images)
- name: Install Amalthea and Ingress-Nginx
run: |
VERSION=$(curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/stable.txt)
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/generate-crd-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Autogenerate the manifests and documentation for the CRD

on:
push:
branches:
- main
workflow_dispatch:

jobs:
generate-crd-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Render chart into manifests
run: |
python -m pip install --upgrade pip pipenv
pipenv install --dev
cd helm-chart/
pipenv run chartpress --reset
cd ../
pipenv run python utils/render-chart-manifests.py
- name: Generate CRD documentation
uses: SwissDataScienceCenter/renku-actions/generate-crd-docs@3d6f5abf79b61d969b0d958e42dabb4e9f15392c
env:
RESOURCES: ./manifests/crd.yaml
OUTPUT: ./docs/crd.md
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
commit-message: "chore: update rendered manifests and CRD docs"
delete-branch: true
title: Update rendered manifests and CRD docs
push-image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Push the image for the current commit
env:
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
run: |
echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin
python -m pip install --upgrade pip pipenv
pipenv install --dev
cd helm-chart/
pipenv run chartpress --tag $(git rev-parse HEAD) --push
pipenv run chartpress --tag latest --push
4 changes: 3 additions & 1 deletion .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: publish-chart

on: [push]
on:
push:
workflow_dispatch:

jobs:
publish-chart:
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ This project defines a custom `JupyterServer`
for Kubernetes and implements a Kubernetes operator which controls the lifecycle
of custom `JupyterServer` objects.

## Installation

The recommended way of installing Amalthea is through its **helm chart**:

```bash
helm repo add renku https://swissdatasciencecenter.github.io/helm-charts
helm install amalthea renku/amalthea
```

For people who prefer to use plain manifests in combination with tools like
`kustomize`, we provide the rendered templates in the
[manifests directory](https://github.com/SwissDataScienceCenter/amalthea/tree/main/manifests),
together with a basic `kustomization.yaml` file which can serve as a base for
overlays. A basic install equivalent to a helm install using the default values
can be achieved through

```bash
kubectl apply -k github.com/SwissDataScienceCenter/amalthea/manifests/
```

## Example

Once Amalthea is installed in a cluster through the helm chart, deploying a
Expand Down Expand Up @@ -87,7 +107,7 @@ change K8s resources which are created as part of the custom resource object.

The main use case of Amalthea is to provide a layer on top of which developers
can build kubernetes-native applications that allow their users to spin-up and
manage Jupyter servers. We do not see Amalthea as a standalone tool
manage Jupyter servers. We do not see Amalthea as a standalone tool
used by end users, as creating Jupyter servers with Amalthea requires access to
the Kubernetes API.

Expand All @@ -107,7 +127,7 @@ The intended scope of Amalthea is much smaller than that. Specifically:
- Amalthea itself is stateless. All state is stored as Kubernetes objects in
etcd.
- Amalthea uses the Kubernetes-native ingress- and service concepts for dynamically
adding and removing routes as Jupyter servers come and go, instead of relying on
adding and removing routes as Jupyter servers come and go, instead of relying on
an additoinal proxy for routing.

## What's in the repo
Expand Down Expand Up @@ -161,6 +181,14 @@ For Amalthea development you will need python 3,
[kubectl](https://Kubernetes.io/docs/tasks/tools/#kubectl) and
[helm](https://helm.sh/docs/intro/install/).

After cloning the repo, you can install the necessary python dependencies and
activate a custom project git hook by running

```bash
pipenv install --dev
git config core.hooksPath .githooks
```

### Kind

The easiest way to set up a cluster that will let you develop and test a feature
Expand Down
Loading