[SDFAB-1197] First stab to update ONOS to py3
Update has been performed only on the scripts and the
executables strictly necessary for the following use cases:
- Build (including Intellij)
- Tests (including Intellij)
- Docker build (including dev and yourkit)
- Upload snapshot (including local)
- Release
Finally, fix the ability to run ONOS using onos-local targets,
stc and docker stc (aka up4 stc env). Last but not least, updated
the azul image to a newer one which exports also the PYTHONENCODING
Change-Id: Ie96f3a9c76dbba83b1fc3896a372f1045d3d7ccc
diff --git a/tools/dev/Dockerfile-bazel b/tools/dev/Dockerfile-bazel
index 4860e04..1eae2df 100644
--- a/tools/dev/Dockerfile-bazel
+++ b/tools/dev/Dockerfile-bazel
@@ -19,8 +19,8 @@
# COPY command incompatibilities).
# e.g. docker build -t onosproject/onos:latest -f $ONOS_ROOT/tools/dev/Dockerfile-bazel $ONOS_ROOT/bazel-bin
-ARG TAG=11.0.8-11.41.23
-ARG JAVA_PATH=/usr/lib/jvm/zulu11-ca-amd64
+ARG TAG=11.0.13-11.52.13
+ARG JAVA_PATH=/usr/lib/jvm/zulu11
# Firts stage to copy and untar ONOS archive inside the container.
FROM bitnami/minideb:jessie as untar
diff --git a/tools/dev/Dockerfile-yourkit b/tools/dev/Dockerfile-yourkit
index 176c3b3..61fbe4f 100644
--- a/tools/dev/Dockerfile-yourkit
+++ b/tools/dev/Dockerfile-yourkit
@@ -17,8 +17,8 @@
ARG JOBS=2
ARG PROFILE=default
-ARG TAG=11.0.8-11.41.23
-ARG JAVA_PATH=/usr/lib/jvm/zulu11-ca-amd64
+ARG TAG=11.0.13-11.52.13
+ARG JAVA_PATH=/usr/lib/jvm/zulu11
# First stage is the build environment.
# zulu-openjdk images are based on Ubuntu.
@@ -30,7 +30,6 @@
ENV BUILD_DEPS \
ca-certificates \
zip \
- python \
python3 \
git \
bzip2 \
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index eaff4b3..f6a9543 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -77,7 +77,7 @@
alias ole='olo "ERROR|WARN|Exception|Error"'
# Pretty-print JSON output
-alias pp='python -m json.tool'
+alias pp='python3 -m json.tool'
# Short-hand to launch Java API docs, REST API docs and ONOS GUI
alias docs='open $ONOS_ROOT/docs/target/site/apidocs/index.html'
diff --git a/tools/dev/bin/onos-gen-bazel-project b/tools/dev/bin/onos-gen-bazel-project
index 355193a..007a13a 100755
--- a/tools/dev/bin/onos-gen-bazel-project
+++ b/tools/dev/bin/onos-gen-bazel-project
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
import os
import subprocess
@@ -31,8 +31,9 @@
def get_library_targets():
this_dir = os.path.dirname(os.path.realpath(__file__))
+ # NOTE that here we depends on bazel generating utf-8 bytes
out = subprocess.check_output([
- "bazel", "query", "kind(\"java_library\", //...:all)"], cwd=this_dir)
+ "bazel", "query", "kind(\"java_library\", //...:all)"], cwd=this_dir, encoding='UTF-8')
return out.strip().split("\n")
@@ -43,12 +44,12 @@
"script_name": os.path.basename(__file__),
"language_level": JAVA_LANGUAGE_LEVEL,
"exclude_dirs": "\n".join(
- map(lambda x: " -" + x, EXCLUDE_DIRECTORIES)),
- "targets": "\n".join(map(lambda x: " " + x, all_targets)),
- "test_sources": "\n".join(map(lambda x: " " + x, TEST_SOURCES)),
+ [" -" + x for x in EXCLUDE_DIRECTORIES]),
+ "targets": "\n".join([" " + x for x in all_targets]),
+ "test_sources": "\n".join([" " + x for x in TEST_SOURCES]),
}
return TEMPLATE.format(**data)
if __name__ == "__main__":
- print gen_project()
+ print(gen_project())