-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: api to s3 * gzip content * check if already exist
- Loading branch information
1 parent
6a08b74
commit fed88aa
Showing
9 changed files
with
523 additions
and
9 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 |
---|---|---|
|
@@ -55,11 +55,16 @@ jobs: | |
- name: Push mediatree_import Image | ||
run: docker push --all-tags ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import | ||
|
||
- name: Build ingest_to_db image | ||
run: docker build -f Dockerfile_ingest . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db | ||
- name: Push ingest_to_db Image | ||
run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db | ||
# Not used anymore | ||
# - name: Build ingest_to_db image | ||
# run: docker build -f Dockerfile_ingest . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db | ||
# - name: Push ingest_to_db Image | ||
# run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db | ||
|
||
- name: Build s3 image | ||
run: docker build -f Dockerfile_api_to_s3 . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3 | ||
- name: Push s3 Image | ||
run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3 | ||
- name: update scaleway job definition with version mediatree_import | ||
uses: jawher/[email protected] | ||
env: | ||
|
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,5 +1,6 @@ | ||
secrets/pwd_api.txt | ||
secrets/username_api.txt | ||
secrets/* | ||
documents-experts/ | ||
cc-bio.json | ||
*.xlsx | ||
|
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,47 @@ | ||
#from https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0 | ||
FROM python:3.12.7 as builder | ||
|
||
ENV VIRTUAL_ENV=/app/.venv | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /app | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
|
||
RUN pip install poetry==1.8.3 | ||
|
||
RUN poetry install | ||
|
||
# The runtime image, used to just run the code provided its virtual environment | ||
FROM python:3.12.7-slim as runtime | ||
|
||
WORKDIR /app | ||
|
||
ENV VIRTUAL_ENV=/app/.venv | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
ENV PATH="$PYENV_ROOT/bin:$PATH" | ||
ENV PYTHONPATH=/app | ||
|
||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
# App code is include with docker-compose as well | ||
COPY quotaclimat ./quotaclimat | ||
COPY postgres ./postgres | ||
COPY pyproject.toml pyproject.toml | ||
COPY alembic/ ./alembic | ||
COPY alembic.ini ./alembic.ini | ||
COPY transform_program.py ./transform_program.py | ||
|
||
# healthcheck | ||
EXPOSE 5050 | ||
|
||
# Use a separate script to handle migrations and start the application | ||
COPY docker-entrypoint.sh ./docker-entrypoint.sh | ||
RUN chmod +x ./docker-entrypoint.sh | ||
|
||
|
||
ENTRYPOINT ["python", "quotaclimat/data_processing/mediatree/s3/api_to_s3.py"] |
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.
fed88aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report