Skip to content

Commit

Permalink
clean history
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Neumann committed Jan 14, 2021
0 parents commit ff42c78
Show file tree
Hide file tree
Showing 114 changed files with 19,704 additions and 0 deletions.
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Python cache files
__pycache__
**/*.pyc

# UI dependencies
ui/node_modules/

# UI build output
ui/build/

# UI package manager debug output
ui/*.log
.skiff/webapp.yaml

# Docker compose env files
.env

# Ignore any files in ./skiff_files
skiff_files/*

### Python Build Related ###

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
140 changes: 140 additions & 0 deletions .skiff/cloudbuild-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# This file tells Google Cloud Build how to deploy the application.
# It can be attached to a variety of triggers, the default being whenever
# someone merges changes to the `master` branch.
steps:
# Pull down the latest versions of each Docker image, so the build is faster.
- id: 'api.pull'
name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: [
'-c',
'docker pull gcr.io/$PROJECT_ID/$REPO_NAME-api:latest || exit 0'
]
waitFor: [ '-' ]
- id: 'ui.pull'
name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: [
'-c',
'docker pull gcr.io/$PROJECT_ID/$REPO_NAME-ui:latest || exit 0'
]
waitFor: [ '-' ]
- id: 'proxy.pull'
name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: [
'-c',
'docker pull gcr.io/$PROJECT_ID/$REPO_NAME-proxy:latest || exit 0'
]
waitFor: [ '-' ]
# Build docker images for each piece of the puzzle
- id: 'api.build'
name: 'gcr.io/cloud-builders/docker'
entrypoint: '/bin/bash'
args: [
'-c',
'docker build -t gcr.io/$PROJECT_ID/$REPO_NAME-api:latest -t gcr.io/$PROJECT_ID/$REPO_NAME-api:$COMMIT_SHA --cache-from gcr.io/$PROJECT_ID/$REPO_NAME-api:latest .'
]
waitFor: [ 'api.pull' ]
dir: 'api'
- id: 'ui.build'
name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'gcr.io/$PROJECT_ID/$REPO_NAME-ui:latest',
'-t', 'gcr.io/$PROJECT_ID/$REPO_NAME-ui:$COMMIT_SHA',
'--cache-from', 'gcr.io/$PROJECT_ID/$REPO_NAME-ui:latest',
'.',
'--build-arg', 'NODE_ENV=production',
'--build-arg', 'BABEL_ENV=production'
]
waitFor: [ 'ui.pull' ]
dir: 'ui'
- id: 'ui.dist.create'
name: 'gcr.io/cloud-builders/docker'
args: [
'create',
'--name', '$REPO_NAME-ui',
'gcr.io/$PROJECT_ID/$REPO_NAME-ui:$COMMIT_SHA',
]
waitFor: [ 'ui.build' ]
dir: 'ui'
- id: 'ui.dist.cp'
name: 'gcr.io/cloud-builders/docker'
args: [
'cp',
'$REPO_NAME-ui:/usr/local/src/skiff/app/ui/build',
'/workspace/proxy/dist'
]
waitFor: ['ui.dist.create']
- id: 'proxy.build'
name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:latest',
'-t', 'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:$COMMIT_SHA',
'--cache-from', 'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:latest',
'.',
'--build-arg', 'CONF_FILE=prod.conf'
]
waitFor: [ 'ui.dist.cp', 'proxy.pull' ]
dir: 'proxy'
- id: 'api.push'
name: 'gcr.io/cloud-builders/docker'
args: [
'push',
'gcr.io/$PROJECT_ID/$REPO_NAME-api:$COMMIT_SHA',
]
waitFor: [ 'api.build' ]
- id: 'proxy.push'
name: 'gcr.io/cloud-builders/docker'
args: [
'push',
'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:$COMMIT_SHA'
]
waitFor: [ 'proxy.build' ]
# Generate our Kubernetes configuration
- id: 'config'
name: 'gcr.io/ai2-reviz/jsonnet'
args: [
'eval',
'-y',
'--output-file', './webapp.yaml',
'--tla-str', 'env=$_ENV',
'--tla-str', 'apiImage=gcr.io/$PROJECT_ID/$REPO_NAME-api:$COMMIT_SHA',
'--tla-str', 'proxyImage=gcr.io/$PROJECT_ID/$REPO_NAME-proxy:$COMMIT_SHA',
'--tla-str', 'sha=$COMMIT_SHA',
'--tla-str', 'cause=Automated Skiff Deploy SHA:$COMMIT_SHA BUILD:$BUILD_ID',
'--tla-str', 'branch=$BRANCH_NAME',
'--tla-str', 'repo=$REPO_NAME',
'--tla-str', 'buildId=$BUILD_ID',
'./webapp.jsonnet'
]
dir: '.skiff'
waitFor: [ '-' ]
# Deploy the image to Kubernetes
- id: 'deploy'
name: 'gcr.io/ai2-reviz/rudder'
args: [
'deploy',
'-f',
'webapp.yaml'
]
dir: '.skiff'
waitFor: [ 'api.push', 'proxy.push', 'config' ]
substitutions:
_ENV: prod
images: [
'gcr.io/$PROJECT_ID/$REPO_NAME-api:$COMMIT_SHA',
'gcr.io/$PROJECT_ID/$REPO_NAME-api:latest',
'gcr.io/$PROJECT_ID/$REPO_NAME-ui:$COMMIT_SHA',
'gcr.io/$PROJECT_ID/$REPO_NAME-ui:latest',
'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:$COMMIT_SHA',
'gcr.io/$PROJECT_ID/$REPO_NAME-proxy:latest'
]
artifacts:
objects:
location: 'gs://skiff-archive/$REPO_NAME/$_ENV/$BUILD_ID/$COMMIT_SHA'
paths: ['.skiff/webapp.yaml']

timeout: 900s
Loading

0 comments on commit ff42c78

Please sign in to comment.