Skip to content

Commit

Permalink
Fixed deploy pipeline and random source
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed Oct 7, 2024
1 parent 0d41792 commit 4174ec7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 35 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,3 @@ jobs:
with:
token: ${{ secrets.PYPI_TOKEN }}
python-version: '3.10.9'

build:
# Need to deploy a PyPi version first to make sure we do not overwrite an old Docker version
needs: [build-and-publish-py-package]
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to the GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Define docker image tags
id: tags
run: |
version=$(cat pyproject.toml | grep version | head -n 1 | sed -e 's/version = "\(.*\)"/\1/')
tags="matsmoll/aligned-ml:${version},matsmoll/aligned-ml:latest"
echo ::set-output name=tags::$tags
- uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
file: Dockerfile
push: true
tags: ${{ steps.tags.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
7 changes: 7 additions & 0 deletions aligned/sources/random_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def multi_source_features_for( # type: ignore
source, _ = requests[0]

async def random_features_for(facts: RetrivalJob, request: RetrivalRequest) -> pl.LazyFrame:

if source.partial_data.is_empty():
df = await facts.to_polars()
random = (await data_for_request(request, df.height)).lazy()
join_columns = set(request.all_returned_columns) - set(df.columns)
return df.hstack(random.select(pl.col(join_columns)).collect()).lazy()

join_columns = set(request.all_returned_columns) - set(source.partial_data.columns)
if not join_columns:
return source.partial_data.lazy()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aligned"
version = "0.0.103"
version = "0.0.104"
description = "A data managment and lineage tool for ML applications."
authors = ["Mats E. Mollestad <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 4174ec7

Please sign in to comment.