-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MRG: Merge branch 'main' into publish-answers-to-question-topic-2
- Loading branch information
Showing
19 changed files
with
1,203 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,11 +81,15 @@ jobs: | |
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: poetry build | ||
|
||
- name: Test package is publishable with PyPI test server | ||
uses: JRubics/poetry-[email protected] | ||
uses: pypa/gh-action-pypi-publish@v1.8.10 | ||
with: | ||
python_version: "3.9" | ||
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_name: "testpypi" | ||
repository_url: "https://test.pypi.org/legacy/" | ||
ignore_dev_requirements: "yes" | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,18 +83,24 @@ jobs: | |
prerelease: false | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and publish latest package to PyPI | ||
uses: JRubics/[email protected] | ||
with: | ||
python_version: "3.9" | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
ignore_dev_requirements: "yes" | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: poetry build | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/[email protected] | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
octue/cloud/deployment/google/cloud_run/Dockerfile-python311
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM windpioneers/gdal-python:little-gecko-gdal-2.4.1-python-3.11-slim | ||
|
||
# Ensure print statements and log messages appear promptly in Cloud Logging. | ||
ENV PYTHONUNBUFFERED True | ||
|
||
ENV PROJECT_ROOT=/workspace | ||
WORKDIR $PROJECT_ROOT | ||
|
||
RUN apt-get update -y && apt-get install -y --fix-missing build-essential && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install poetry. | ||
ENV POETRY_HOME=/root/.poetry | ||
ENV PATH "$POETRY_HOME/bin:$PATH" | ||
RUN curl -sSL https://install.python-poetry.org | python3 - && poetry config virtualenvs.create false; | ||
|
||
# Copy in the dependencies file(s) for caching. One or more of `requirements.txt`, `setup.py`, and `pyproject.toml and | ||
# `poetry.lock` must be present. | ||
COPY pyproject.tom[l] poetry.loc[k] setup.p[y] requirements.tx[t] ./ | ||
|
||
# If `pyproject.toml` is present, install the dependencies only to utilise layer caching for quick rebuilds. | ||
RUN if [ -f "pyproject.toml" ]; then poetry install \ | ||
--no-ansi \ | ||
--no-interaction \ | ||
--no-cache \ | ||
--no-root \ | ||
--only main; \ | ||
fi | ||
|
||
# Copy local code to the application root directory. | ||
COPY . . | ||
|
||
# Install local packages if using poetry. Otherwise, install everything if using `setup.py` or `requirements.txt`. | ||
RUN if [ -f "pyproject.toml" ]; then poetry install --only main; \ | ||
elif [ -f "setup.py" ]; then pip install --upgrade pip && pip install -e .; \ | ||
elif [ -f "requirements.txt" ]; then pip install --upgrade pip && pip install -r requirements.txt; fi | ||
|
||
EXPOSE $PORT | ||
|
||
ENV USE_OCTUE_LOG_HANDLER=1 | ||
ENV COMPUTE_PROVIDER=GOOGLE_CLOUD_RUN | ||
|
||
ARG GUNICORN_WORKERS=1 | ||
ENV GUNICORN_WORKERS=$GUNICORN_WORKERS | ||
|
||
ARG GUNICORN_THREADS=8 | ||
ENV GUNICORN_THREADS=$GUNICORN_THREADS | ||
|
||
# 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 $GUNICORN_WORKERS --threads $GUNICORN_THREADS --timeout 0 octue.cloud.deployment.google.cloud_run.flask_app:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.