Skip to content

Commit 5b76f9a

Browse files
authored
CI should work on python 3.6 (feast-dev#1237)
* should work on python 3.6 Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com> * latest git Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
1 parent f8be8f8 commit 5b76f9a

4 files changed

Lines changed: 41 additions & 12 deletions

File tree

.github/workflows/complete.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
run: make lint-go
6666

6767
lint-versions:
68-
container: gcr.io/kf-feast/feast-ci:latest
6968
runs-on: [ubuntu-latest]
7069
steps:
7170
- uses: actions/checkout@v2

infra/docker/ci/Dockerfile

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1-
FROM maven:3.6-jdk-11
1+
FROM ubuntu:18.04
22

33
ARG REVISION
4+
ENV DEBIAN_FRONTEND=noninteractive
45

5-
# Install Google Cloud SDK
6-
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" \
7-
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
8-
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
9-
| apt-key --keyring /usr/share/keyrings/cloud.google.gpg \
10-
add - && apt-get update -y && apt-get install google-cloud-sdk -y
6+
RUN apt-get update && apt-get install -y curl unzip locales software-properties-common && \
7+
apt-add-repository ppa:git-core/ppa && \
8+
apt update && apt install -y git
9+
10+
# Install Java (by default openjdk-11)
11+
RUN apt-get install -y default-jdk
12+
13+
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.utf8
14+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
15+
16+
# Install maven
17+
ARG MAVEN_VERSION=3.6.3
18+
ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
19+
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
20+
21+
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
22+
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
23+
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
24+
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
25+
&& rm -f /tmp/apache-maven.tar.gz \
26+
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
27+
28+
ENV MAVEN_HOME /usr/share/maven
29+
ENV MAVEN_CONFIG "/root/.m2"
1130

1231
# Install Make and Python
13-
ENV PYTHON_VERSION 3.7
32+
ENV PYTHON_VERSION 3.6
1433

1534
RUN apt-get install -y build-essential curl python${PYTHON_VERSION} \
1635
python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distutils && \
@@ -20,6 +39,13 @@ RUN apt-get install -y build-essential curl python${PYTHON_VERSION} \
2039
python get-pip.py --force-reinstall && \
2140
rm get-pip.py
2241

42+
# Install Google Cloud SDK
43+
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" \
44+
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
45+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
46+
| apt-key --keyring /usr/share/keyrings/cloud.google.gpg \
47+
add - && apt-get update -y && apt-get install google-cloud-sdk -y
48+
2349
# Instal boto3
2450
RUN pip install boto3==1.16.10
2551

infra/scripts/codebuild_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async def run_build(project_name: str, source_version: str, source_location: str
162162
log_group=build["logs"]["groupName"],
163163
)
164164

165-
waiter_task = asyncio.create_task(
165+
waiter_task = asyncio.get_event_loop().create_task(
166166
_wait_build_state(
167167
codebuild_client,
168168
build_id,
@@ -188,4 +188,5 @@ async def run_build(project_name: str, source_version: str, source_location: str
188188

189189

190190
if __name__ == "__main__":
191-
asyncio.run(main())
191+
loop = asyncio.get_event_loop()
192+
loop.run_until_complete(main())

sdk/python/feast/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
click.option("--serving-url", help="Set Feast serving URL to connect to"),
3737
click.option("--job-service-url", help="Set Feast job service URL to connect to"),
3838
]
39+
DATETIME_ISO = "%Y-%m-%dT%H:%M:%s"
3940

4041

4142
def common_options(func):
@@ -381,7 +382,9 @@ def sync_offline_to_online(feature_table: str, start_time: str, end_time: str):
381382
client = Client()
382383
table = client.get_feature_table(feature_table)
383384
client.start_offline_to_online_ingestion(
384-
table, datetime.fromisoformat(start_time), datetime.fromisoformat(end_time)
385+
table,
386+
datetime.strptime(start_time, DATETIME_ISO),
387+
datetime.strptime(end_time, DATETIME_ISO),
385388
)
386389

387390

0 commit comments

Comments
 (0)