-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into plugin-fix
- Loading branch information
Showing
21 changed files
with
1,124 additions
and
1,028 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.dockerignore | ||
.venv |
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,57 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'New version' | ||
required: true | ||
|
||
jobs: | ||
update-and-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update pyproject.toml version | ||
run: | | ||
sed -i "s/^version = .*/version = \"${{ github.event.inputs.version }}\"/" pyproject.toml | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git commit -am "ci: Version bump ${{ github.event.inputs.version }}" | ||
git push | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ vars.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Build and push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 #,linux/arm64 future ;) | ||
push: true | ||
tags: ${{ vars.DOCKER_IMAGE_NAME }}:${{ github.event.inputs.version }}, ${{ secrets.DOCKER_IMAGE_NAME }}:latest | ||
|
||
- name: Push version bump commit | ||
run: | | ||
git tag ${{ github.event.inputs.version }} | ||
git push origin ${{ github.event.inputs.version }} | ||
git push | ||
- name: Create GitHub Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.event.inputs.version }} | ||
release_name: Release ${{ github.event.inputs.version }} | ||
draft: false | ||
prerelease: false |
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ docs/build | |
.venv | ||
dist | ||
*~ | ||
.python-version |
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 |
---|---|---|
@@ -1,39 +1,27 @@ | ||
FROM dssat/dssat-csm | ||
FROM dssat/dssat-csm:v4.8.2.0 | ||
|
||
COPY . /app/pythia | ||
RUN ln -sf /bin/bash /bin/sh && \ | ||
# install pre-reqs for pyenv installed pythons | ||
apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \ | ||
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | ||
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git libspatialindex-dev && \ | ||
# setup pyenv | ||
curl https://pyenv.run | bash && \ | ||
echo 'export PATH="/root/.pyenv/bin:/root/.local/bin:$PATH"' >> ~/.bashrc && \ | ||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc && \ | ||
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc && \ | ||
export PATH="/root/.pyenv/bin:/root/.local/bin:$PATH" && \ | ||
eval "$(pyenv init -)" && \ | ||
eval "$(pyenv virtualenv-init i)" && \ | ||
# install python 3.7.9 | ||
pyenv install 3.7.9 && \ | ||
pyenv rehash && \ | ||
pyenv virtualenv 3.7.9 pythia-3.7.9 && \ | ||
pyenv activate pythia-3.7.9 && \ | ||
pip install --upgrade pip && \ | ||
pip install pipenv && \ | ||
# install dependencies | ||
cd /app/pythia && \ | ||
pipenv install && \ | ||
echo "#!/bin/bash" > /app/pythia.sh && \ | ||
echo "" >> /app/pythia.sh && \ | ||
echo 'export PATH="/root/.pyenv/bin:/root/.local/bin:$PATH"' >> /app/pythia.sh && \ | ||
echo 'export PYENV_VIRTUALENV_DISABLE_PROMPT=1' >> /app/pythia.sh && \ | ||
echo 'eval "$(pyenv init -)"' >> /app/pythia.sh && \ | ||
echo 'eval "$(pyenv virtualenv-init -)"' >> /app/pythia.sh && \ | ||
echo "pyenv activate pythia-3.7.9" >> /app/pythia.sh && \ | ||
echo "python /app/pythia/pythia.py \$@" >> /app/pythia.sh && \ | ||
echo "pyenv deactivate" && \ | ||
chmod 755 /app/pythia.sh | ||
RUN apt-get update && apt-get install -y \ | ||
python3.11 \ | ||
python3.11-dev \ | ||
python3-pip \ | ||
python3-venv \ | ||
python3-poetry \ | ||
python3-virtualenv \ | ||
curl \ | ||
gdal-bin=3.6.2+dfsg-1+b2 \ | ||
libgdal-dev=3.6.2+dfsg-1+b2 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT ["/app/pythia.sh"] | ||
CMD ["-h"] | ||
ENV GDAL_VERSION 3.6.2 | ||
ENV C_INCLUDE_PATH=/usr/include/python3.11/cpython | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/python3.11/cpython | ||
|
||
WORKDIR /app/pythia | ||
|
||
COPY pyproject.toml poetry.toml poetry.lock ./ | ||
RUN POETRY_VIRTUALENVS_CREATE=false poetry install --no-interaction --no-ansi | ||
|
||
COPY . ./ | ||
ENV PATH="${PATH}:/app/pythia/bin" | ||
|
||
ENTRYPOINT ["pythia"] |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env sh | ||
#!/usr/bin/env bash | ||
|
||
python -m pythia $@ | ||
source .venv/bin/activate | ||
python3 -m pythia $@ |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.