Skip to content

Commit

Permalink
Merge pull request #116 from etna-team/issue-92
Browse files Browse the repository at this point in the history
Fix docker image with new numpy
  • Loading branch information
martins0n committed Oct 20, 2023
2 parents f9e1f11 + 39022de commit dbcde5e
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 18 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/docker-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ on:
- master

jobs:

push:

docker-build-and-push:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
dockerfile:
- {"name": etna-cpu, "path": docker/etna-cpu/Dockerfile}
- {"name": etna-cuda-11.6.2, "path": docker/etna-cuda-11.6.2/Dockerfile}

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install -E all -vv
- name: Build image
run: |
cd $( dirname ${{ matrix.dockerfile.path }})
sed -i 's#etna\[all\]#etna[all] @ git+https://github.com/${{ github.repository }}.git@${{ github.sha }}#g' requirements.txt
echo "etna[all] @ git+https://github.com/${{ github.repository }}.git@${{ github.sha }}" > requirements.txt
poetry export -E "all jupyter" --without-hashes --format=requirements.txt >> requirements.txt
cat requirements.txt
docker build . --tag image
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.dockerfile.name }}
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- created

jobs:
publish:
publish-package:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
Expand Down Expand Up @@ -85,18 +85,28 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install -E all -vv
- name: Build image
run: |
cd $( dirname ${{ matrix.dockerfile.path }})
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
sed -i "s#etna\[all\]#etna\[all\]==$VERSION#g" requirements.txt
echo "etna[all]==$VERSION" > requirements.txt
poetry export -E "all jupyter" --without-hashes --format=requirements.txt >> requirements.txt
cat requirements.txt
docker build . --tag image
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.dockerfile.name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Rendering table of contents in notebooks ([#1343](https://github.com/tinkoff-ai/etna/pull/1343))
- Fix formatting of docstrings, fix links from netlify to docs.etna.ai ([#62](https://github.com/etna-team/etna/pull/62))
- Fix multiple warnings, revert catching warnings during testing ([#105](https://github.com/etna-team/etna/pull/105))
- Fix bug with `numpy.warnings` in `numpy>=1.24`, rework building docker images to use `poetry.lock` ([#116](https://github.com/etna-team/etna/pull/116))

### Removed
- FutureMixin ([#58](https://github.com/etna-team/etna/pull/58))
Expand Down
2 changes: 0 additions & 2 deletions docker/etna-cpu/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions docker/etna-cuda-11.6.2/requirements.txt

This file was deleted.

13 changes: 13 additions & 0 deletions etna/transforms/math/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
from etna.transforms.math.sklearn import TransformMode


def _replace_warnings():
"""Set ``numpy.warnings`` to be set to ``warnings``.
It mimics `the patch <https://github.com/scikit-learn/scikit-learn/pull/23654>`_.
"""
import warnings

import numpy as np

np.warnings = warnings


class YeoJohnsonTransform(SklearnTransform):
"""YeoJohnsonTransform applies Yeo-Johns transformation to a DataFrame.
Expand Down Expand Up @@ -149,4 +161,5 @@ def params_to_tune(self) -> Dict[str, BaseDistribution]:
return grid


_replace_warnings()
__all__ = ["BoxCoxTransform", "YeoJohnsonTransform"]

0 comments on commit dbcde5e

Please sign in to comment.