27 Commits

Author SHA1 Message Date
pierventre
69db90c26e [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
2022-07-29 13:09:20 +02:00
pierventre
5489c2f6b1 [SDFAB-1196] Build ONOS with Bazel 6.0.0 pre-release
This was a quite big jump (3.7.2 -> 6.x.x) and we had
to face the deprecation of several components.

- javabase/host_javabase -> java_language_version and
java_runtime_version

- java_toolchain/host_java_toolchain -> java_language_version
and java_runtime_version

- Turnedoff "ReturnValueIgnored" related to ErrorProne

- Moved to bazelisk v1.11.0

- patched again the grpc code due to the deprecation of host_javabase
as java_toolcahin contains already this information.

- resource_jars are also handled as resources because java constructs
do not accept them anymore.

- Use the OSGIWrapper to fix the path of the resource_hars and untar them.
Additionally clean up the code and enable/disable logging through a param.

- Fix absolute_javabase in the Dockerfile by providing the absolute
path of the local jvm through local_java_repository. The latter is
appended to the WORKSPACE file on demand inside the Dockerfile.

Change-Id: I96e06fe52b3b49a1a34f01443eec583a95347323
(cherry picked from commit 846c8b167f3e3aa8086b3eab3df94154a75dc423)
2022-07-29 07:42:16 +00:00
Carmelo Cascone
5c2807cf9d Use bazelisk inside Dockerfile
To make sure we build using the same Bazel version used for CI and other
builds.

Change-Id: I261c4bce1b3bb2d4f818f702110ae581b5e2c6f4
(cherry picked from commit 5524134a4ea7914d5e814e7f4acf496a68044790)
2020-09-01 19:53:16 +00:00
pierventre
3883c604b5 Fix for ONOS dockerfile that was broken as the absolute path of java was changed in the azul images.
Update the jvm path in the dockerfile and pin the docker image to a more specific tag.

Change-Id: Idc0feea6380974b1e1f93e39af697b36147e6fef
2020-07-28 16:43:01 +00:00
Jonathan Hart
bdf39a7560 Allow passing 'profile' argument to docker build
Change-Id: I42c1216bf9431e9c6ac059ca21abc7c80252de09
2020-02-25 13:53:23 -08:00
Jonathan Hart
91f3cb6179 Add curl to ONOS docker image for use with healthchecks.
Change-Id: I78e482a76455ae40c0748a29d48e3e24c6de57e5
2019-12-02 21:24:00 +00:00
Carmelo Cascone
f66f77911c Replace references to old versions of Bazel with 1.0
Change-Id: I2998e0b13ec3f9df4d7ec2a5bccdf46a66d9e065
2019-11-22 06:13:48 +00:00
Brian O'Connor
bae733a4fe Revert "Making docker.host.internal resolvable in Docker for Linux"
This reverts commit ea8cb7565ee8a74db3dfff950a8369d790d48101.

Change-Id: I0bc557c4d8da62ac3fd552056e1a335d25104835
2019-10-11 00:52:36 +00:00
Brian O'Connor
ea8cb7565e Making docker.host.internal resolvable in Docker for Linux
Change-Id: Icc74d1aeccf44f68b785b786cae8eafe65700e66
2019-10-10 00:50:03 +00:00
Carmelo Cascone
e5b1d250d4 Reduce size of Docker image by using zulu openjdk images
Also, we make sure to use the same JDK for build and runtime.

Change-Id: Ie9c5df1192401e229d3212baf51acf323cf6b594
2019-07-02 01:59:00 +00:00
Carmelo Cascone
d33d3b4838 Build ONOS exclusively with Bazel-provided remote JDK
This change make it possible to build ONOS in a host system without JDK
installed, or ignoring the one installed, instead relying exclusively on
the "remote" JDK provided by Bazel. The JDK version, along with the
toolchain configuration (language source and target values), are checked
in as part of the build files (tools/build/bazel/BUILD), thus enabling
deterministic builds that are less dependent of the host environment.

To allow this, this change replaces all references to JDK-related tools
expected to be on the host PATH, such as the jar command, with their
counterpart from the remote JDK (now a sandboxed relative path). This is
achieved by:

  * Creating a new "jdk_genrule" macro that exposes the remote JDK bin
    directory to the PATH visible by the genrule command. This is used
    for all genrule targets invoking for example `jar`;
  * Modifying custom Starlak rule implementations by replacing
    invocation to JDK tools with a path from the remote one.
  * Renaming the onos/lib directory to onos/deps as it clashes with
    the Bazel-provided JDK's lib directory (that for some strange reason
    is resolved on the ONOS workspace)

Finally, this change is reflected on the Dockerfile which now builds
ONOS from an Ubuntu image with no JDK installed.

Change-Id: Ie7d990cfce6fef00ddb4ffffe4c6205b8530fb47
2019-06-18 22:26:33 +00:00
Ray Milkey
a69d7646a5 Upgrade docker build to bazel 0.23
Change-Id: Ia659a4ff18cd3913fa9ffd73e1d28c0e1774a43c
2019-02-27 09:19:07 -08:00
Ray Milkey
c3a1491110 Change JDK container for Docker build
- the image we were using is no longer supported
- we are now using an OpenJDK 8 image for docker builds
- removed Jono as author and put in myself

Change-Id: I7a4d607da32d1da4449e7421b6df1d23ea9eb9f4
2019-02-15 10:00:57 -08:00
Ray Milkey
6f5b646aa7 Use Open JDK 11 for docker image
Change-Id: I5ef9a4fd3777c9aeb285a9e4dd985232de5175e6
2018-12-14 03:41:21 +00:00
Ray Milkey
716166f78b Upgrade bazel version to 0.19 for docker build
Change-Id: I8d86a4db66297a1684c4faa35a535013c99ea3c2
2018-11-09 18:58:53 +00:00
Ray Milkey
4c2d16455e Bump up docker image build to bazel version 0.17.1
Change-Id: I29b749aa46b31d87fcd879e058a92b4e5733a64d
2018-09-24 17:27:33 +00:00
Ray Milkey
b42f4dd24f Reduce the number of bazel jobs to allow building docker image on laptops
Change-Id: Id1e161011bdb3a23183b092ba14415035b633c5b
2018-08-14 17:59:04 +00:00
Ray Milkey
b38701eb4a Docker build using bazel
Change-Id: I0f2377b71b73c8ec19e15734c5ddb7810ab6ab39
2018-08-14 15:44:18 +00:00
Ray Milkey
200b384159 Allow docker build to set the git hash based version string
Change-Id: Ia9db74bfcaea9eb1fc91bdfb1941f00a86e7c964
(cherry picked from commit 50e43f030632df9b1f9797b5344f51f6cb25999a)
2018-04-06 21:35:06 +00:00
Charles Chan
47c6e26275 Fix dependency and permission issue in docker build
Change-Id: Ie0263b2ba6d98f5ca2bc63029987e7ad3e84fd6c
2017-10-04 13:36:48 -07:00
Jonathan Hart
3e86419fdf Configure ONOS in docker image to log to stdout
Change-Id: Ia7f900663298750de7c1d67b9bf0f181b5f6f452
2017-07-27 17:32:33 +00:00
Jonathan Hart
15a71d8d6a ONOS docker image is going on a diet.
Refactored the Dockerfile to use a multi-stage build which allows us to
separate build environment from runtime environment.
Also added labels.

Change-Id: I9bdf63d9224711c5b5ed342bbe233a26d51283a9
2017-07-26 23:39:14 +00:00
Ray Milkey
9d81ea5722 Fixes for Docker build
- add runtime dependency on git
- set ONOS_ROOT before doing build
- Add top level directory to grpc proto compiler include directories

Change-Id: I6e7a119a122f708988cce28090c9bc7011808b78
2017-07-20 20:21:37 +00:00
Jimmy Ou
0fe2138541 Fix script to install what onos-user-key need in Docker debian:jessie image
- Install ssh package
- Create ~/.ssh directory

Change-Id: Id6e486fd63f178a6311d41b9216872ca48c61ad2
2017-06-13 07:02:54 +00:00
Jonathan Hart
9bdf5da497 Fixing dockerhub build.
The latest debian:jessie image doesn't seem to like the command
"apt-get remove --purge -y `apt-mark showauto`".
It tries to remove a number of important base packages.
It doesn't seem to save a lot of space anyway.

Change-Id: If55b319f7d74698398d76650fa1c4a8d8475bb63
2017-06-13 07:02:40 +00:00
Ray Milkey
8c05c9b3e6 Suppress errors for non-ASCII characters in Java files
Change-Id: Iaedc76b640326ee967b7d05937dadce75bb29639
2017-03-16 21:32:08 +00:00
Jonathan Hart
77daee891b Move Dockerfile to repository root.
It seems to be mandatory to have the Dockerfile here if we want to build
from the source in the repo in a Dockerhub automated build.

ONOS-5832

Change-Id: I01536ae9476987f20df03560834b1adcf0b6aec0
2017-01-17 15:29:59 +00:00