Mercurial > code > home > repos > gcalendarwatch
changeset 15:72ebd60d640e
containerization updates
author | drewp@bigasterisk.com |
---|---|
date | Sun, 13 Sep 2020 14:35:37 -0700 |
parents | 8c040ebe7b7c |
children | a87969972d85 |
files | .style.yapf .vscode/settings.json Dockerfile deploy.yaml gcalendarwatch.py requirements.txt serv.n3 skaffold.yaml tasks.py |
diffstat | 9 files changed, 90 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.style.yapf Sun Sep 13 14:35:37 2020 -0700 @@ -0,0 +1,4 @@ +# overwritten by /home/drewp/bin/setup_home_venv +[style] +based_on_style = google +column_limit = 130
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.vscode/settings.json Sun Sep 13 14:35:37 2020 -0700 @@ -0,0 +1,10 @@ +{ + "python.linting.pylintEnabled": false, + "python.linting.flake8Enabled": true, + "python.linting.enabled": true, + "python.pythonPath": "/home/drewp/.venvs/gcalendarwatch/bin/python", + "python.formatting.provider": "yapf", + "files.watcherExclude": { + "_darcs_old/**": true + } +}
--- a/Dockerfile Sun Feb 09 22:30:32 2020 -0800 +++ b/Dockerfile Sun Sep 13 14:35:37 2020 -0700 @@ -1,11 +1,22 @@ -FROM bang6:5000/base_x86 +FROM ubuntu:focal + +ENV TZ=America/Los_Angeles +ENV LANG=en_US.UTF-8 + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + WORKDIR /opt +RUN apt-get update +RUN apt-get install -y python3-pip +RUN apt-get install -y git + + COPY requirements.txt ./ RUN pip3 install --index-url https://projects.bigasterisk.com/ --extra-index-url https://pypi.org/simple -r requirements.txt # not sure why this doesn't work from inside requirements.txt -RUN pip3 install --index-url https://projects.bigasterisk.com/ --extra-index-url https://pypi.org/simple -U 'https://github.com/drewp/cyclone/archive/python3.zip?v2' +#RUN pip3 install --index-url https://projects.bigasterisk.com/ --extra-index-url https://pypi.org/simple -U 'https://github.com/drewp/cyclone/archive/python3.zip?v2' COPY gcalendarwatch.py *.credentials *.conf *.html *.json *.dat ./
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy.yaml Sun Sep 13 14:35:37 2020 -0700 @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gcalendarwatch +spec: + replicas: 1 + selector: + matchLabels: + app: gcalendarwatch + template: + metadata: + labels: + app: gcalendarwatch + spec: + containers: + - name: gcalendarwatch + image: bang5:5000/gcalendarwatch_image + ports: + - containerPort: 9105 + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: "kubernetes.io/hostname" + operator: In + values: ["bang"] +--- +apiVersion: v1 +kind: Service +metadata: + name: gcalendarwatch +spec: + ports: + - {port: 80, targetPort: 9105, name: metrics} + selector: + app: gcalendarwatch + +
--- a/gcalendarwatch.py Sun Feb 09 22:30:32 2020 -0800 +++ b/gcalendarwatch.py Sun Sep 13 14:35:37 2020 -0700 @@ -1,5 +1,3 @@ -#!/usr/bin/python3 - """ sync google calendar into mongodb, return queries from that as JSON-LD.
--- a/requirements.txt Sun Feb 09 22:30:32 2020 -0800 +++ b/requirements.txt Sun Sep 13 14:35:37 2020 -0700 @@ -1,15 +1,14 @@ +google_auth_oauthlib==0.4.1 +google-api-python-client==1.11.0 +google-auth==1.21.1 oauth2client==4.1.3 -google-auth==1.6.3 -google-api-python-client==1.7.9 -google_auth_oauthlib==0.4.0 +prometheus_client==0.8.0 +pymongo==3.11.0 +python-dateutil==2.8.1 +rdflib==4.2.2 +Twisted[tls]==20.3.0 +docopt==0.6.2 -python-dateutil==2.5.3 -pymongo==3.2.2 -rdflib==4.2.2 -Twisted -cyclone - -git+http://github.com/drewp/scales.git@448d59fb491b7631877528e7695a93553bfaaa93#egg=scales https://github.com/drewp/cyclone/archive/python3.zip cycloneerr
--- a/serv.n3 Sun Feb 09 22:30:32 2020 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -@prefix : <http://bigasterisk.com/ns/serv#> . -@prefix auth: <http://bigasterisk.com/ns/serv/auth#> . -@prefix serv: <http://bigasterisk.com/services/> . - - -serv:gcalendarwatch a :Service; - :path "/gcalendarwatch/"; - :openid auth:admin; - :serverHost "bang"; - :internalPort 9105; - :prodDockerFlags ( - "-p" "9105:9105" - "--net=host" - ); - :localDockerFlags ( - "-v" "`pwd`:/opt" - ); - :localRunCmdline ( - "python3" "gcalendarwatch.py" "-v" - ); - :dockerFile "Dockerfile" -. -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/skaffold.yaml Sun Sep 13 14:35:37 2020 -0700 @@ -0,0 +1,15 @@ +apiVersion: skaffold/v2beta5 +kind: Config +metadata: + name: gcalendarwatch +build: + tagPolicy: + dateTime: + format: "2006-01-02_15-04-05" + timezone: "Local" + artifacts: + - image: bang5:5000/gcalendarwatch_image +deploy: + kubectl: + manifests: + - deploy.yaml