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

Commit 2b1693b

Browse files
committed
Merge branches 'cache' and 'py2'
2 parents d1cb41d + 851e61e commit 2b1693b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1252
-878
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ build --verbose_failures
1010
# in a container this fails to run tests.
1111
build --spawn_strategy=standalone --genrule_strategy=standalone
1212
test --test_strategy=standalone --test_output=streamed
13+
build --python_path=python3

.circleci/config.yml

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
version: 2
22

3+
SETUP_UBUNTU: &SETUP_UBUNTU
4+
name: Setup system
5+
command: |
6+
apt update
7+
apt install -y openjdk-8-jdk curl python python3 python3-wheel xz-utils
8+
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
9+
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
10+
apt update
11+
apt install -y bazel
12+
cat > .bazelrc <<EOF
13+
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
14+
startup --host_jvm_args=-Xmx2500m
15+
startup --host_jvm_args=-Xms2500m
16+
startup --batch
17+
# This is so we understand failures better
18+
build --verbose_failures
19+
# This is so we don't use sandboxed execution. Sandboxed execution
20+
# runs stuff in a container, and since GitLabCI already runs its script
21+
# in a container this fails to run tests.
22+
build --spawn_strategy=standalone --genrule_strategy=standalone
23+
test --test_strategy=standalone --test_output=streamed --nocache_test_results
24+
build --show_progress_rate_limit 3
25+
build --local_resources=4000,2,1.0
26+
EOF
27+
328
jobs:
429
build:
530
docker:
@@ -9,6 +34,11 @@ jobs:
934
- run:
1035
name: Install dependencies
1136
command: |
37+
cat > /etc/pacman.d/mirrorlist <<EOF
38+
Server = https://archlinux.surlyjake.com/archlinux/\$repo/os/\$arch
39+
Server = http://mirrors.evowise.com/archlinux/\$repo/os/\$arch
40+
Server = http://mirror.rackspace.com/archlinux/\$repo/os/\$arch
41+
EOF
1242
pacman -Syu --noconfirm jdk8-openjdk bazel gcc make python-virtualenv python-wheel
1343
- run:
1444
name: Configure bazel
@@ -44,14 +74,14 @@ jobs:
4474

4575
release-ubuntu-14.04:
4676
docker:
47-
- image: ubuntu:14.04.4
77+
- image: ubuntu:14.04.5
4878
steps:
4979
- checkout
5080
- run:
5181
name: Setup system
5282
command: |
5383
apt-get update
54-
apt-get -y install software-properties-common curl build-essential python3-wheel python-virtualenv python3-dev python3-setuptools zip
84+
apt-get -y install software-properties-common curl build-essential python-wheel python-dev python-setuptools zip
5585
add-apt-repository -y ppa:webupd8team/java
5686
add-apt-repository -y ppa:ubuntu-toolchain-r/test
5787
apt-get update
@@ -82,11 +112,53 @@ jobs:
82112
environment:
83113
- CC: gcc-4.9
84114
- CXX: g++-4.9
85-
command: ./release.sh
115+
command: .circleci/release.sh
86116
- store_artifacts:
87117
path: ./release
88118
destination: ubuntu-14.04
89119

120+
release-ubuntu-16.04:
121+
docker:
122+
- image: ubuntu:16.04
123+
steps:
124+
- checkout
125+
- run:
126+
<<: *SETUP_UBUNTU
127+
- run:
128+
name: Build release
129+
command: bazel build //release:release-deb -c opt --python_path=python3
130+
- store_artifacts:
131+
path: ./bazel-bin/release
132+
destination: ubuntu-16.04
133+
134+
release-ubuntu-17.10:
135+
docker:
136+
- image: ubuntu:17.10
137+
steps:
138+
- checkout
139+
- run:
140+
<<: *SETUP_UBUNTU
141+
- run:
142+
name: Build release
143+
command: bazel build //release:release-deb -c opt --python_path=python3
144+
- store_artifacts:
145+
path: ./bazel-bin/release
146+
destination: ubuntu-17.10
147+
148+
release-ubuntu-18.04:
149+
docker:
150+
- image: ubuntu:18.04
151+
steps:
152+
- checkout
153+
- run:
154+
<<: *SETUP_UBUNTU
155+
- run:
156+
name: Build release
157+
command: bazel build //release:release-deb -c opt --python_path=python3
158+
- store_artifacts:
159+
path: ./bazel-bin/release
160+
destination: ubuntu-18.04
161+
90162
release-archlinux:
91163
docker:
92164
- image: base/archlinux
@@ -113,7 +185,7 @@ jobs:
113185
EOF
114186
- run:
115187
name: Build release
116-
command: ./release.sh
188+
command: .circleci/release.sh
117189
- store_artifacts:
118190
path: ./release
119191
destination: archlinux
@@ -135,11 +207,35 @@ workflows:
135207
ignore: /.*/
136208
tags:
137209
only: /^v.*/
210+
- release-ubuntu-16.04:
211+
requires:
212+
- build
213+
filters:
214+
branches:
215+
ignore: /.*/
216+
tags:
217+
only: /^v.*/
218+
- release-ubuntu-17.10:
219+
requires:
220+
- build
221+
filters:
222+
branches:
223+
ignore: /.*/
224+
tags:
225+
only: /^v.*/
226+
- release-ubuntu-18.04:
227+
requires:
228+
- build
229+
filters:
230+
branches:
231+
ignore: /.*/
232+
tags:
233+
only: /^v.*/
138234
- release-archlinux:
139235
requires:
140236
- build
141237
filters:
142238
branches:
143239
ignore: /.*/
144240
tags:
145-
only: /^v.*/
241+
only: /^v.*/
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
#!/bin/bash -e
22
set -x
33

4-
cd $(dirname $0)
4+
TEMPDIR=/tmp/task_maker
5+
ROOT=$(echo "$(cd "$(dirname "$0")"; pwd)")/..
6+
CIRCLE_TAG=${CIRCLE_TAG:-unknown}
7+
OUT_FILE=$ROOT/release/task-maker-$CIRCLE_TAG.zip
58

6-
TEMPDIR=/tmp
9+
cd $ROOT
710

811
bazel build -c opt //python:task_maker
9-
mkdir -p $TEMPDIR/task_maker
10-
cp -r bazel-bin/python/task_maker.runfiles bazel-bin/python/task_maker -L $TEMPDIR/task_maker
12+
mkdir -p $TEMPDIR
13+
cp -r bazel-bin/python/task_maker.runfiles bazel-bin/python/task_maker -L $TEMPDIR
1114

12-
pushd $TEMPDIR/task_maker
15+
pushd $TEMPDIR
1316

1417
chmod u+w -R .
15-
for dep in $(cd task_maker.runfiles/; ls -d pypi*)
16-
do
17-
rm -rf task_maker.runfiles/$dep
18-
ln -s oii_task_maker/external/$dep task_maker.runfiles
19-
done
2018
find . -type f -name '*.pyc' -delete
2119
rm -rf task_maker.runfiles/oii_task_maker/_solib_k8
2220
find . -type f -name '*.so' | xargs strip -s || true
2321
find . -type f -name 'manager' | xargs strip -s || true
2422
find . -type f -print0 | xargs -0 chmod u-w
2523

26-
popd
24+
(cd .. && zip -r $OUT_FILE task_maker)
2725

28-
mkdir release
29-
zip -r release/task-maker-$CIRCLE_TAG.zip $TEMPDIR/task_maker
26+
popd

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ __pycache__/
66
.mypy_cache/
77
*.pyc
88
*pyo
9-
.idea
9+
.idea
10+
release/*.zip

WORKSPACE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ new_git_repository(
3636
# Rules for Python
3737
git_repository(
3838
name = "io_bazel_rules_python",
39-
commit = "63cdc8f29b6e6ff517744756cc67cf05577ae724",
40-
remote = "https://github.com/bazelbuild/rules_python",
39+
commit = "3d703d11769c7e400696f44ca1c3e9cefe7312a7",
40+
remote = "https://github.com/joshclimacell/rules_python",
4141
)
4242

43-
load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import")
43+
load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip3_import")
4444

4545
pip_repositories()
4646

47-
pip_import(
47+
pip3_import(
4848
name = "python_deps",
4949
requirements = "//tools:requirements.txt",
5050
)

core/execution.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class Execution {
6161
int32_t StatusCode() const { return response_.status_code(); }
6262
int32_t Signal() const { return response_.signal(); }
6363

64+
bool Cached() const { return cached_; }
65+
6466
Execution(const Execution&) = delete;
6567
Execution& operator=(const Execution&) = delete;
6668
Execution(Execution&&) = delete;

manager/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cc_library(
2323
"//core",
2424
"//core:execution",
2525
"//external:glog",
26+
"//proto:manager_cc",
2627
"//proto:task_cc",
2728
"//util:which",
2829
"@com_google_absl//absl/types:optional",

0 commit comments

Comments
 (0)