Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 4f71b23

Browse files
authored
Speed up CI (typedb#181)
## What is the goal of this PR? Cut the time spent on CI jobs by upgrading to latest `@rules_python` and `pip` ## What are the changes implemented in this PR? Use latest `pip` (both in standalone tests and in Bazel targets) to ensure that `grpcio` native library is not rebuilt from scratch every time but just fetched from PyPI.
1 parent ca4588c commit 4f71b23

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.grabl/automation.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ build:
5353
type: foreground
5454
command: |
5555
pyenv global 3.6.10
56+
pip3 install -U pip
5657
pip install -r requirements_dev.txt
5758
sudo unlink /usr/bin/python3
5859
sudo ln -s $(which python3) /usr/bin/python3
@@ -66,6 +67,7 @@ build:
6667
type: foreground
6768
command: |
6869
pyenv global 3.6.10
70+
pip3 install -U pip
6971
pip install -r requirements_dev.txt
7072
sudo unlink /usr/bin/python3
7173
sudo ln -s $(which python3) /usr/bin/python3
@@ -79,6 +81,7 @@ build:
7981
type: foreground
8082
command: |
8183
pyenv global 3.6.10
84+
pip3 install -U pip
8285
pip install -r requirements_dev.txt
8386
sudo unlink /usr/bin/python3
8487
sudo ln -s $(which python3) /usr/bin/python3
@@ -93,6 +96,7 @@ build:
9396
type: foreground
9497
command: |
9598
pyenv global 3.6.10
99+
pip3 install -U pip
96100
pip install -r requirements_dev.txt
97101
sudo unlink /usr/bin/python3
98102
sudo ln -s $(which python3) /usr/bin/python3
@@ -109,6 +113,7 @@ build:
109113
type: foreground
110114
command: |
111115
pyenv global 3.6.10
116+
pip3 install -U pip
112117
pip install -r requirements_dev.txt
113118
sudo unlink /usr/bin/python3
114119
sudo ln -s $(which python3) /usr/bin/python3
@@ -125,6 +130,7 @@ build:
125130
type: foreground
126131
command: |
127132
pyenv global 3.6.10
133+
pip3 install -U pip
128134
pip install -r requirements_dev.txt
129135
sudo unlink /usr/bin/python3
130136
sudo ln -s $(which python3) /usr/bin/python3
@@ -142,6 +148,7 @@ build:
142148
type: foreground
143149
command: |
144150
pyenv global 3.6.10
151+
pip3 install -U pip
145152
sudo unlink /usr/bin/python3
146153
sudo ln -s $(which python3) /usr/bin/python3
147154
sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py
@@ -157,6 +164,7 @@ build:
157164
type: foreground
158165
command: |
159166
pyenv global 3.6.10
167+
pip3 install -U pip
160168
sudo unlink /usr/bin/python3
161169
sudo ln -s $(which python3) /usr/bin/python3
162170
sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py
@@ -182,6 +190,7 @@ release:
182190
command: |
183191
pyenv install -s 3.6.10
184192
pyenv global 3.6.10 system
193+
pip3 install -U pip
185194
pip install certifi
186195
export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME
187196
export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD
@@ -195,6 +204,7 @@ release:
195204
command: |
196205
pyenv install -s 3.6.10
197206
pyenv global 3.6.10 system
207+
pip3 install -U pip
198208
export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME
199209
export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD
200210
bazel run @graknlabs_dependencies//distribution/artifact:create-netrc

WORKSPACE

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ kt_register_toolchains()
4444
# Load //builder/python
4545
load("@graknlabs_dependencies//builder/python:deps.bzl", python_deps = "deps")
4646
python_deps()
47-
load("@rules_python//python:pip.bzl", "pip_repositories", "pip3_import")
47+
load("@rules_python//python:pip.bzl", "pip_repositories", "pip_import")
4848
pip_repositories()
4949

5050
# Load //builder/grpc
@@ -58,8 +58,6 @@ com_github_grpc_grpc_deps()
5858
load("@graknlabs_dependencies//tool/common:deps.bzl", "graknlabs_dependencies_ci_pip",
5959
graknlabs_dependencies_tool_maven_artifacts = "maven_artifacts")
6060
graknlabs_dependencies_ci_pip()
61-
load("@graknlabs_dependencies_ci_pip//:requirements.bzl", graknlabs_dependencies_pip_install = "pip_install")
62-
graknlabs_dependencies_pip_install()
6361

6462
# Load //tool/checkstyle
6563
load("@graknlabs_dependencies//tool/checkstyle:deps.bzl", checkstyle_deps = "deps")
@@ -81,8 +79,6 @@ rules_pkg_dependencies()
8179
# Load //pip
8280
load("@graknlabs_bazel_distribution//pip:deps.bzl", pip_deps = "deps")
8381
pip_deps()
84-
load("@graknlabs_bazel_distribution_pip//:requirements.bzl", graknlabs_bazel_distribution_pip_install = "pip_install")
85-
graknlabs_bazel_distribution_pip_install()
8682

8783
# Load //github
8884
load("@graknlabs_bazel_distribution//github:deps.bzl", github_deps = "deps")
@@ -105,13 +101,11 @@ graknlabs_grakn_cluster_artifacts()
105101
# Load @graknlabs_client_python #
106102
#################################
107103

108-
pip3_import(
104+
load("@rules_python//python:pip.bzl", "pip_install")
105+
pip_install(
109106
name = "graknlabs_client_python_pip",
110107
requirements = "//:requirements_dev.txt",
111108
)
112-
load("@graknlabs_client_python_pip//:requirements.bzl",
113-
graknlabs_client_python_pip_install = "pip_install")
114-
graknlabs_client_python_pip_install()
115109

116110
############################
117111
# Load @maven dependencies #

dependencies/graknlabs/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def graknlabs_dependencies():
2323
git_repository(
2424
name = "graknlabs_dependencies",
2525
remote = "https://github.com/graknlabs/dependencies",
26-
commit = "1fe947a6a7f78d6b0dbe14481cdd0d6929988e5e", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_dependencies
26+
commit = "87e44466b11b7e6b24bcfd847430ffd904af9232", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_dependencies
2727
)
2828

2929
def graknlabs_common():

0 commit comments

Comments
 (0)