Balint Uveges | 871fa39 | 2019-04-02 20:31:11 +0000 | [diff] [blame] | 1 | #================================================================================== |
| 2 | # Copyright (c) 2019 AT&T Intellectual Property. |
| 3 | # Copyright (c) 2019 Nokia |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 16 | # |
| 17 | # This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 18 | # platform project (RICP). |
Balint Uveges | 871fa39 | 2019-04-02 20:31:11 +0000 | [diff] [blame] | 19 | #================================================================================== |
Balint Uveges | 871fa39 | 2019-04-02 20:31:11 +0000 | [diff] [blame] | 20 | |
Lott, Christopher (cl778h) | 419d851 | 2019-06-05 15:51:17 -0400 | [diff] [blame] | 21 | # The CI system creates and publishes the rtmgr Docker image |
| 22 | # from the last step in this multi-stage build and applies |
| 23 | # a Docker tag from the string in file container-tag.yaml |
| 24 | |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 25 | #FROM golang:1.12.1 as rtmgrbuild |
wahidw | 480359e | 2020-04-06 06:56:02 +0000 | [diff] [blame] | 26 | FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:5-u18.04-nng as rtmgrbuild |
Balint Uveges | 871fa39 | 2019-04-02 20:31:11 +0000 | [diff] [blame] | 27 | |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 28 | # Install RMr shared library |
wahidw | fc1f59a | 2020-04-07 13:32:41 +0530 | [diff] [blame^] | 29 | ARG RMRVERSION=3.6.2 |
wahidw | dd6b056 | 2020-03-31 03:09:45 +0000 | [diff] [blame] | 30 | RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb && rm -rf rmr_${RMRVERSION}_amd64.deb |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 31 | # Install RMr development header files |
wahidw | dd6b056 | 2020-03-31 03:09:45 +0000 | [diff] [blame] | 32 | RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb && rm -rf rmr-dev_${RMRVERSION}_amd64.deb |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 33 | |
| 34 | ENV GOLANG_VERSION 1.12.1 |
| 35 | RUN wget --quiet https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz \ |
| 36 | && tar xvzf go$GOLANG_VERSION.linux-amd64.tar.gz -C /usr/local |
| 37 | ENV PATH="/usr/local/go/bin:${PATH}" |
| 38 | ENV GOPATH /go |
| 39 | |
| 40 | RUN mkdir -p /go/bin |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 41 | RUN cd /go/bin \ |
| 42 | && wget --quiet https://github.com/go-swagger/go-swagger/releases/download/v0.19.0/swagger_linux_amd64 \ |
| 43 | && mv swagger_linux_amd64 swagger \ |
| 44 | && chmod +x swagger |
| 45 | |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 46 | |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 47 | WORKDIR /go/src/routing-manager |
zkoczka | eb2ff0d | 2019-09-26 16:59:54 +0200 | [diff] [blame] | 48 | COPY api/ /go/src/routing-manager/api |
| 49 | COPY LICENSE LICENSE |
| 50 | RUN mkdir pkg |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 51 | |
| 52 | RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/appmgr" \ |
1000044 | e90ddda | 2019-08-01 09:58:52 +0200 | [diff] [blame] | 53 | && cp appmgr/api/appmgr_rest_api.yaml api/ \ |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 54 | && rm -rf appmgr |
| 55 | |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 56 | RUN /go/bin/swagger generate server -f api/routing_manager.yaml -t pkg/ --exclude-main -r LICENSE |
| 57 | RUN /go/bin/swagger generate client -f api/appmgr_rest_api.yaml -t pkg/ -m appmgr_model -c appmgr_client -r LICENSE |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 58 | |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 59 | ENV GO111MODULE=on |
| 60 | ENV GOPATH "" |
| 61 | COPY go.sum go.sum |
| 62 | COPY go.mod go.mod |
zkoczka | eb2ff0d | 2019-09-26 16:59:54 +0200 | [diff] [blame] | 63 | COPY pkg pkg |
| 64 | COPY cmd cmd |
| 65 | COPY run_rtmgr.sh /run_rtmgr.sh |
wahidw | dd6b056 | 2020-03-31 03:09:45 +0000 | [diff] [blame] | 66 | RUN mkdir manifests |
| 67 | COPY manifests/ /go/src/routing-manager/manifests |
wahidw | 480359e | 2020-04-06 06:56:02 +0000 | [diff] [blame] | 68 | COPY "uta_rtg_ric.rt" / |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 69 | ENV GOPATH /go |
zkoczka | eb2ff0d | 2019-09-26 16:59:54 +0200 | [diff] [blame] | 70 | |
| 71 | ENV GOBIN /go/bin |
| 72 | RUN go install ./cmd/rtmgr.go |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 73 | |
| 74 | # UT intermediate container |
wahidw | fc1f59a | 2020-04-07 13:32:41 +0530 | [diff] [blame^] | 75 | #FROM rtmgrbuild as rtmgrut |
| 76 | #RUN ldconfig |
| 77 | #ENV RMR_SEED_RT "/uta_rtg_ric.rt" |
| 78 | #RUN go test ./pkg/sbi ./pkg/rpe ./pkg/nbi ./pkg/sdl -f "/go/src/routing-manager/manifests/rtmgr/rtmgr-cfg.yaml" -cover -race |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 79 | |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 80 | # Final, executable container |
wahidw | 480359e | 2020-04-06 06:56:02 +0000 | [diff] [blame] | 81 | FROM ubuntu:18.04 |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 82 | COPY --from=rtmgrbuild /go/bin/rtmgr / |
| 83 | COPY --from=rtmgrbuild /run_rtmgr.sh / |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 84 | COPY --from=rtmgrbuild /usr/local/include /usr/local/include |
| 85 | COPY --from=rtmgrbuild /usr/local/lib /usr/local/lib |
wahidw | 598215e | 2020-03-31 10:36:36 +0000 | [diff] [blame] | 86 | COPY "uta_rtg_ric.rt" / |
wahidw | a8596ec | 2019-12-05 06:30:42 +0000 | [diff] [blame] | 87 | RUN ldconfig |
wahidw | 5e864c7 | 2019-12-10 05:02:10 +0000 | [diff] [blame] | 88 | RUN apt-get update && apt-get install -y iputils-ping net-tools curl tcpdump |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 89 | RUN mkdir /db && touch /db/rt.json && chmod 777 /db/rt.json |
wrider | d0f6509 | 2019-07-09 16:38:09 -0400 | [diff] [blame] | 90 | RUN chmod 755 /run_rtmgr.sh |
kalnagy | 9216265 | 2019-07-02 15:15:49 +0200 | [diff] [blame] | 91 | CMD /run_rtmgr.sh |