Skip to content

Commit

Permalink
Bigquery docker image (#995)
Browse files Browse the repository at this point in the history
* Added bigquery dockerfile

Signed-off-by: pmahindrakar-oss <[email protected]>

* removed opencv dependencies

Signed-off-by: pmahindrakar-oss <[email protected]>

---------

Signed-off-by: pmahindrakar-oss <[email protected]>
  • Loading branch information
pmahindrakar-oss authored Jun 6, 2023
1 parent e12536c commit 95cbf07
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
37 changes: 37 additions & 0 deletions cookbook/integrations/gcp/bigquery/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM python:3.8-slim-buster
LABEL org.opencontainers.image.source https://github.com/flyteorg/flytesnacks

WORKDIR /root
ENV VENV /opt/venv
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONPATH /root

RUN apt-get update && apt-get install -y build-essential curl

WORKDIR /opt
RUN curl https://sdk.cloud.google.com > install.sh
RUN bash /opt/install.sh --install-dir=/opt
ENV PATH $PATH:/opt/google-cloud-sdk/bin
WORKDIR /root

ENV VENV /opt/venv
# Virtual environment
RUN python3 -m venv ${VENV}
ENV PATH="${VENV}/bin:$PATH"

# Install Python dependencies
COPY bigquery/requirements.txt /root
RUN pip install -r /root/requirements.txt

# Copy the makefile targets to expose on the container. This makes it easier to register
COPY in_container.mk /root/Makefile
COPY bigquery/sandbox.config /root

# Copy the actual code
COPY bigquery/ /root/bigquery

# This tag is supplied by the build script and will be used to determine the version
# when registering tasks, workflows, and launch plans
ARG tag
ENV FLYTE_INTERNAL_IMAGE $tag
14 changes: 0 additions & 14 deletions cookbook/integrations/gcp/bigquery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,3 @@ PREFIX=bigquery
include ../../../common/common.mk
include ../../../common/leaf.mk

.PHONY: docker_build
docker_build: ;

.PHONY: docker_push
docker_push: ;

.PHONY: register
register: ;

.PHONY: serialize
serialize: ;

.PHONY: docker_push
docker_push: ;
6 changes: 3 additions & 3 deletions cookbook/integrations/gcp/bigquery/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
name="sql.bigquery.no_io",
inputs={},
query_template="SELECT 1",
task_config=BigQueryConfig(ProjectID="flyte", Location="us-west1-b"),
task_config=BigQueryConfig(ProjectID="flyte"),
)


Expand All @@ -46,8 +46,8 @@ def no_io_wf():
# Define inputs as well as their types that can be used to customize the query.
inputs=kwtypes(version=int),
output_structured_dataset_type=DogeCoinDataset,
task_config=BigQueryConfig(ProjectID="flyte", Location="us-west1-b"),
query_template="SELECT * FROM `bigquery-public-data.crypto_dogecoin.transactions` WHERE @version = 1 LIMIT 10;",
task_config=BigQueryConfig(ProjectID="flyte"),
query_template="SELECT * FROM `bigquery-public-data.crypto_dogecoin.transactions` WHERE version = 1 LIMIT 10;",
)


Expand Down

0 comments on commit 95cbf07

Please sign in to comment.