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

fix(app): keep git-proxy alive on session shutdown #951

Merged
merged 18 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from 17 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
56 changes: 39 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ name: CI
on: [push]

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.3.3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
Expand All @@ -27,21 +19,47 @@ jobs:
run: |
pytest tests/unit renku_notebooks

test-git-proxy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- name: Test git proxy
run: |
cd git-https-proxy
go test -v

test-git-services:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
cd git_services
poetry install
- name: Test git services
run: |
cd git_services
poetry run pytest -v tests

test-chart:
needs: test
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master'"
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install helm
env:
HELM_URL: https://storage.googleapis.com/kubernetes-helm
HELM_TGZ: helm-v2.17.0-linux-amd64.tar.gz
TEMP_DIR: ${{ runner.temp }}
run: ./install_helm.sh
uses: azure/setup-helm@v1
- name: Test chart
run: |
PATH=${{ runner.temp }}/linux-amd64/:$PATH
Expand All @@ -54,7 +72,11 @@ jobs:

publish-chart-tagged:
runs-on: ubuntu-latest
needs: test-chart
needs:
- test-chart
- test
- test-git-proxy
- test-git-services
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 7 additions & 7 deletions git-https-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:15.14-alpine3.12
FROM golang:1.18.0-alpine3.15 as builder
COPY . /src
WORKDIR /src
RUN go build -o /git-http-proxy main.go

LABEL maintainer="Swiss Data Science Center <info@datascience.ch>"

COPY package.json package-lock.json mitmproxy.js ./
RUN npm ci && npm cache clean --force

CMD ["node", "--use-openssl-ca", "/mitmproxy.js"]
FROM alpine:3.15
COPY --from=builder /git-http-proxy /git-http-proxy
ENTRYPOINT ["/git-http-proxy"]
14 changes: 14 additions & 0 deletions git-https-proxy/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module SwissDataScienceCenter/renku-notebooks/git-https-proxy

go 1.18

require (
github.com/elazarl/goproxy v0.0.0-20220328115640-894aeddb713e
github.com/stretchr/testify v1.7.1
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
16 changes: 16 additions & 0 deletions git-https-proxy/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elazarl/goproxy v0.0.0-20220328115640-894aeddb713e h1:99KFda6F/mw8xSfceY2JEVCrYWX7l+Ms6BcO5wEct+Q=
github.com/elazarl/goproxy v0.0.0-20220328115640-894aeddb713e/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading