Skip to content

Commit 95cbf07

Browse files
Bigquery docker image (#995)
* 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]>
1 parent e12536c commit 95cbf07

File tree

3 files changed

+40
-17
lines changed

3 files changed

+40
-17
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM python:3.8-slim-buster
2+
LABEL org.opencontainers.image.source https://github.com/flyteorg/flytesnacks
3+
4+
WORKDIR /root
5+
ENV VENV /opt/venv
6+
ENV LANG C.UTF-8
7+
ENV LC_ALL C.UTF-8
8+
ENV PYTHONPATH /root
9+
10+
RUN apt-get update && apt-get install -y build-essential curl
11+
12+
WORKDIR /opt
13+
RUN curl https://sdk.cloud.google.com > install.sh
14+
RUN bash /opt/install.sh --install-dir=/opt
15+
ENV PATH $PATH:/opt/google-cloud-sdk/bin
16+
WORKDIR /root
17+
18+
ENV VENV /opt/venv
19+
# Virtual environment
20+
RUN python3 -m venv ${VENV}
21+
ENV PATH="${VENV}/bin:$PATH"
22+
23+
# Install Python dependencies
24+
COPY bigquery/requirements.txt /root
25+
RUN pip install -r /root/requirements.txt
26+
27+
# Copy the makefile targets to expose on the container. This makes it easier to register
28+
COPY in_container.mk /root/Makefile
29+
COPY bigquery/sandbox.config /root
30+
31+
# Copy the actual code
32+
COPY bigquery/ /root/bigquery
33+
34+
# This tag is supplied by the build script and will be used to determine the version
35+
# when registering tasks, workflows, and launch plans
36+
ARG tag
37+
ENV FLYTE_INTERNAL_IMAGE $tag

cookbook/integrations/gcp/bigquery/Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,3 @@ PREFIX=bigquery
22
include ../../../common/common.mk
33
include ../../../common/leaf.mk
44

5-
.PHONY: docker_build
6-
docker_build: ;
7-
8-
.PHONY: docker_push
9-
docker_push: ;
10-
11-
.PHONY: register
12-
register: ;
13-
14-
.PHONY: serialize
15-
serialize: ;
16-
17-
.PHONY: docker_push
18-
docker_push: ;

cookbook/integrations/gcp/bigquery/bigquery.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
name="sql.bigquery.no_io",
2121
inputs={},
2222
query_template="SELECT 1",
23-
task_config=BigQueryConfig(ProjectID="flyte", Location="us-west1-b"),
23+
task_config=BigQueryConfig(ProjectID="flyte"),
2424
)
2525

2626

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

5353

0 commit comments

Comments
 (0)