Skip to content

Commit

Permalink
SAASMLOPS-910 add the setuptools_scm pretend version
Browse files Browse the repository at this point in the history
  • Loading branch information
brijesh-vora-sp committed Feb 2, 2024
1 parent 8dc6135 commit 3dddca9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
sh """
/kaniko/executor \
--context ./ \
--dockerfile ./sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile \
--dockerfile ./sailpoint-bytewax.dockerfile \
--build-arg DOCKER_BUILDKIT=1 \
--destination=${ECR_REPOSITORY}/${REPOSITORY_NAME}:${BUILD_NUMBER}
"""
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
requires = ["setuptools>=60", "wheel", "setuptools_scm>=6.2", "grpcio", "grpcio-tools>=1.47.0", "mypy-protobuf==3.1", "sphinx!=4.0.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# Including this section is comparable to supplying use_scm_version=True in setup.py.

[tool.black]
line-length = 88
Expand Down
27 changes: 27 additions & 0 deletions sailpoint-bytewax.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM 406205545357.dkr.ecr.us-east-1.amazonaws.com/sailpoint/python3.10:1 AS build

RUN dnf install --refresh -y git

WORKDIR /bytewax

# Copy dataflow code
COPY sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_dataflow.py /bytewax
COPY sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py /bytewax

# Copy entrypoint
COPY sdk/python/feast/infra/materialization/contrib/bytewax/entrypoint.sh /bytewax

# Copy necessary parts of the Feast codebase
COPY sdk/python sdk/python
COPY protos protos
COPY go go
COPY setup.py setup.py
COPY pyproject.toml pyproject.toml
COPY README.md README.md

# Install Feast for AWS with Bytewax dependencies
# We need this mount thingy because setuptools_scm needs access to the
# git dir to infer the version of feast we're installing.
# https://github.com/pypa/setuptools_scm#usage-from-docker
# I think it also assumes that this dockerfile is being built from the root of the directory.
RUN --mount=source=.git,target=.git,type=bind SETUPTOOLS_SCM_PRETEND_VERSION=1 pip3 install --no-cache-dir '.[aws,gcp,bytewax,snowflake,postgres]'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM 406205545357.dkr.ecr.us-east-1.amazonaws.com/sailpoint/python3.10:1 AS build
FROM python:3.9-slim-bullseye AS build

RUN dnf install --refresh -y git
RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends --yes git

WORKDIR /bytewax

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def run(self):
"Programming Language :: Python :: 3.7",
],
entry_points={"console_scripts": ["feast=feast.cli:cli"]},
use_scm_version=use_scm_version,
setup_requires=[
"setuptools_scm",
"grpcio>=1.56.2,<2",
Expand Down

0 comments on commit 3dddca9

Please sign in to comment.