From 2392e6e49a6567a5d7477a93780b327238ee98b8 Mon Sep 17 00:00:00 2001 From: Anssi Mannila Date: Mon, 21 Mar 2022 14:21:31 +0200 Subject: [PATCH] Go version update - Issue-ID: RIC-881 - Go version changed 1.14.1 -> 1.17.8 - Dockerfile update accordingly - Certificate update in dockerfile removed - RTMGR version in docker file updated to latest version - Outdated routing_manager.yaml file in api folder updated Change-Id: Icf2a5caed4973cf84c89bf0f75f3168d8d74b77b Signed-off-by: Anssi Mannila --- Dockerfile | 25 +++------- api/routing_manager.yaml | 117 +++++++++++++++++++++++++++++++++++++++++++++-- container-tag.yaml | 2 +- go.mod | 48 ++++++++++++++++++- 4 files changed, 168 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d13c48..5d42436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,22 +25,16 @@ ########################################################### FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as submgrcore -ARG g14="1.14.4" -ARG GOVERSION="1.14" -RUN wget -nv https://dl.google.com/go/go${g14}.linux-amd64.tar.gz \ - && tar -xf go${g14}.linux-amd64.tar.gz \ +ARG GOVERSION="1.17.8" +RUN wget -nv https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz \ + && tar -xf go${GOVERSION}.linux-amd64.tar.gz \ && mv go /opt/go/${GOVERSION} \ && rm -f go*.gz + ENV DEFAULTPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PATH=$DEFAULTPATH:/usr/local/go/bin:/opt/go/${GOVERSION}/bin:/root/go/bin -# Update CA certificates -RUN apt update && apt install --reinstall -y \ - ca-certificates \ - && \ - update-ca-certificates - RUN apt update && apt install -y iputils-ping net-tools curl tcpdump gdb valgrind WORKDIR /tmp @@ -66,9 +60,7 @@ RUN wget --quiet ${SWAGGERURL} \ # GO DELVE # RUN export GOBIN=/usr/local/bin/ ; \ - go get -u github.com/go-delve/delve/cmd/dlv \ - && go install github.com/go-delve/delve/cmd/dlv - + go install github.com/go-delve/delve/cmd/dlv@latest # # RMR @@ -81,7 +73,7 @@ RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb -RUN mkdir /manifests/ +RUN mkdir -p /manifests/ RUN echo "rmrlib ${RMRVERSION} ${RMRLIBURL}" >> /manifests/versions.txt RUN echo "rmrdev ${RMRVERSION} ${RMRDEVURL}" >> /manifests/versions.txt RUN echo "swagger ${SWAGGERVERSION} ${SWAGGERURL}" >> /manifests/versions.txt @@ -145,15 +137,12 @@ RUN go mod download RUN mkdir pkg COPY api api - -ARG RTMGRVERSION=cd7867c8f527f46fd8702b0b8d6b380a8e134bea - +ARG RTMGRVERSION=8becf0c4e06bc89b13d217a102eb7a50470cddc5 RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/rtmgr" \ && git -C "rtmgr" checkout $RTMGRVERSION \ && cp rtmgr/api/routing_manager.yaml api/ \ && rm -rf rtmgr - RUN mkdir -p /root/go && \ swagger generate client -f api/routing_manager.yaml -t pkg/ -m rtmgr_models -c rtmgr_client diff --git a/api/routing_manager.yaml b/api/routing_manager.yaml index c8a742b..fc93ab5 100644 --- a/api/routing_manager.yaml +++ b/api/routing_manager.yaml @@ -1,4 +1,3 @@ -# #================================================================================== # Copyright (c) 2019 AT&T Intellectual Property. # Copyright (c) 2019 Nokia @@ -38,6 +37,8 @@ tags: # url: "http://127.0.0.1" - name: "health" description: "Health of the system" +- name: "debug" + description: "Debug Information" schemes: #- "https" - "http" @@ -60,6 +61,24 @@ paths: description: "The health of the system" schema: "$ref": "#/definitions/health-status" + /getdebuginfo: + get: + tags: + - "debug" + summary: "Get Information for debugging" + description: "By performing a GET method, API caller is able to get the dump of routes tables, subcription list and E2T's" + operationId: "get_debuginfo" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 200: + description: "Debug Info from routing manager" + schema: + "$ref": "#/definitions/debuginfo" + 201: + description: "Error while fetching Debug data" /handles: get: tags: @@ -276,6 +295,53 @@ paths: description: "Invalid data" 201: description: "ran instances disociated" + /handles/addrmrroute: + post: + tags: + - "handle" + summary: "API to add RMR routes" + description: "By performing a POST method to add RMR routes" + operationId: "add_rmr_route" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: body + name: routes-list + description: "list of routes to add" + required: true + schema: + $ref: "#/definitions/routelist" + responses: + 400: + description: "Invalid data" + 201: + description: "rmr routes added" + + /handles/delrmrroute: + delete: + tags: + - "handle" + summary: "API to delete RMR routes" + description: "By performing a DELETE method to add RMR routes" + operationId: "del_rmr_route" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: body + name: routes-list + description: "list of routes to delete" + required: true + schema: + $ref: "#/definitions/routelist" + responses: + 400: + description: "Invalid data" + 201: + description: "rmr routes added" definitions: health-status: type: "object" @@ -368,10 +434,53 @@ definitions: $ref: '#/definitions/ranNamelist' ranAssocList: $ref: "#/definitions/ran-e2t-map" - + endpoint: + type: "object" + properties: + EndPointName: + type: "string" + EndPointFqdn: + type: "string" + EndPointPort: + type: "integer" + format: "uint16" + minimum: 0 + maximum: 65535 + + debuginfo: + type: "object" + required: + - "RouteTable" + properties: + RouteTable: + type: "array" + items: + type: "string" + RouteConfigs: + type: "string" + add-rmr-route: + type: "object" + required: + - "TargetEndPoint" + - "MessageType" + properties: + TargetEndPoint: + type: "string" + MessageType: + type: "integer" + format: "uint32" + SenderEndPoint: + type: "string" + SubscriptionID: + type: "integer" + format: "int32" + + routelist: + type: "array" + items: + $ref: '#/definitions/add-rmr-route' + externalDocs: description: "Routing Manager" url: "http://placeholder" - - diff --git a/container-tag.yaml b/container-tag.yaml index 096ff14..f181b76 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -2,4 +2,4 @@ # By default this file is in the docker build directory, # but the location can configured in the JJB template. --- -tag: "0.8.2" +tag: "0.8.3" diff --git a/go.mod b/go.mod index c8f8b02..40116f4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gerrit.o-ran-sc.org/r/ric-plt/submgr -go 1.14 +go 1.17 replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.8.0 @@ -25,3 +25,49 @@ require ( github.com/spf13/viper v1.4.0 github.com/stretchr/testify v1.5.1 ) + +require ( + gerrit.o-ran-sc.org/r/com/golog v0.0.2 // indirect + gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0 // indirect + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.2.1 // indirect + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.2.1 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect + github.com/beorn7/perks v1.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/docker/go-units v0.4.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/go-openapi/analysis v0.19.5 // indirect + github.com/go-openapi/jsonpointer v0.19.3 // indirect + github.com/go-openapi/jsonreference v0.19.3 // indirect + github.com/go-openapi/loads v0.19.4 // indirect + github.com/go-openapi/spec v0.19.3 // indirect + github.com/go-redis/redis v6.15.9+incompatible // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jessevdk/go-flags v1.4.0 // indirect + github.com/magiconair/properties v1.8.0 // indirect + github.com/mailru/easyjson v0.7.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v0.9.3 // indirect + github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect + github.com/prometheus/common v0.4.0 // indirect + github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/stretchr/objx v0.2.0 // indirect + go.mongodb.org/mongo-driver v1.1.2 // indirect + golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 // indirect + golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect + golang.org/x/text v0.3.2 // indirect + google.golang.org/protobuf v1.23.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect +) -- 2.16.6