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

Removed top-level rest_api_* folders #40

Closed
wants to merge 3 commits into from
Closed
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
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ master ]
branches: [master]

jobs:

# Build the Flask-GCBM REST API Setup
# Build the Flask-GCBM REST API Setup

build-gcbm-api:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rest_api_gcbm
working-directory: ./local/rest_api_gcbm
steps:
- uses: actions/checkout@v2
- name: Build FLINT Cloud container
Expand All @@ -38,3 +37,18 @@ jobs:
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"

linting-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Lint Dockerfile"
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: " ./local/rest_api_flint.example/Dockerfile
./local/rest_api_gcbm/Dockerfile
./layered/cloud-run/Dockerfile
./layered/compute-engine/Dockerfile
./layered/ingress/Dockerfile"
error_level: 0
output_format: tty
6 changes: 6 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignored:
- DL3006
- DL3007
- DL3008
- DL3009
- DL3013
5 changes: 5 additions & 0 deletions docs/DevelopmentSetup/git_and_github_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,8 @@ Incase your pull request needs further changes, you can update your pull request
::

git push origin <your-branch-name> --force

About Hadolint
------------------------

`Hadolint <https://hub.docker.com/r/hadolint/hadolint>`_ is a Dockerfile linter that helps you build best practice Docker images.
9 changes: 5 additions & 4 deletions layered/cloud-run/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ ENV PYTHONUNBUFFERED True

# Copy application dependency manifests to the container image.
# Copying this separately prevents re-running pip install on every code change.
WORKDIR /
COPY requirements.txt ./

# Install production dependencies.
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --upgrade setuptools && \
python3 -m pip install -r requirements.txt
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir --upgrade setuptools && \
python3 -m pip install --no-cache-dir -r requirements.txt

# Copy local code to the container image.
ENV APP_HOME /app
Expand All @@ -23,4 +24,4 @@ COPY . ./
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app
CMD ["exec", "gunicorn", "--bind", ":$PORT", "--workers", "1", "--threads", "8", "--timeout", "0", "main:app"]
9 changes: 5 additions & 4 deletions layered/compute-engine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ ENV PYTHONUNBUFFERED True

# Copy application dependency manifests to the container image.
# Copying this separately prevents re-running pip install on every code change.
WORKDIR /
COPY requirements.txt ./

# Install production dependencies.
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --upgrade setuptools && \
python3 -m pip install -r requirements.txt
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir --upgrade setuptools && \
python3 -m pip install --no-cache-dir -r requirements.txt

# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./

# Run startup script
CMD python3 main.py
CMD ["python3", "main.py"]
7 changes: 4 additions & 3 deletions layered/ingress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install packages
RUN apt-get update -y && \
apt-get install -y python3-gdal libgdal-dev
apt-get install -y --no-install-recommends python3-gdal libgdal-dev

# Copy application dependency manifests to the container image.
# Copying this separately prevents re-running pip install on every code change.
WORKDIR /
COPY requirements.txt ./

# Install production dependencies.
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy local code to the container image.
ENV APP_HOME /app
Expand All @@ -28,4 +29,4 @@ COPY . ./
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app
CMD ["exec", "gunicorn", "--bind", ":$PORT", "--workers", "1", "--threads", "8", "--timeout", "0", "main:app"]
6 changes: 3 additions & 3 deletions local/rest_api_flint.example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ WORKDIR /server
RUN set -xe \
&& apt-get update \
&& easy_install pip
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt ./
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
ENV PORT 8080

COPY . .

CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 app:app
CMD ["exec", "gunicorn", "--bind", ":$PORT", "--workers", "1", "--threads", "8", "--timeout", "0", "app:app"]
6 changes: 3 additions & 3 deletions local/rest_api_gcbm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ WORKDIR /app
RUN set -xe \
&& apt-get update \
&& easy_install pip
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt ./
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
ENV PORT 8080

COPY . .

CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 app:app
CMD ["exec", "gunicorn", "--bind", ":$PORT", "--workers", "1", "--threads", "8", "--timeout", "0", "app:app"]
17 changes: 0 additions & 17 deletions rest_api_flint.example/Dockerfile

This file was deleted.

200 changes: 0 additions & 200 deletions rest_api_flint.example/app.py

This file was deleted.

5 changes: 0 additions & 5 deletions rest_api_flint.example/config/libs.base.simple.json

This file was deleted.

Loading