Commit a46ac88e authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Merge remote-tracking branch 'origin/develop' into develop-SRS-feedback

parents 76c112a8 af04fa90
......@@ -90,14 +90,23 @@ class Cluster:
logging.error('error while creating buildconfig: ' + sshSession.getBefore())
return False
def _recreate_is(self, sshSession, name, newTag, filename):
sshSession.command(f'sed -i -e "s#tag: *latest#tag: {newTag}#" {filename}', '\$', 5)
sshSession.command(f'oc delete -f {filename}', '\$', 5)
sshSession.command(f'oc create -f {filename}', '\$', 5)
def _recreate_is_tag(self, sshSession, name, newTag, filename):
sshSession.command(f'oc describe is {name}', '\$', 5)
if sshSession.getBefore().count('NotFound') > 0:
sshSession.command(f'oc create -f {filename}', '\$', 5)
before = sshSession.getBefore()
if re.search(f'imagestream.image.openshift.io/{name} created', before) is None:
logging.error('error while creating imagestream: ' + sshSession.getBefore())
return False
else:
logging.debug(f'-> imagestream {name} found')
image = f'{name}:{newTag}'
sshSession.command(f'oc delete istag {image}', '\$', 5) # we don't care if this fails, e.g., if it is missing
sshSession.command(f'oc create istag {image}', '\$', 5)
before = sshSession.getBefore()
if re.search('imagestream.image.openshift.io/[a-zA-Z\-0-9]+ created', before) is not None:
if re.search(f'imagestreamtag.image.openshift.io/{image} created', before) is not None:
return True
logging.error('error while creating imagestream: ' + sshSession.getBefore())
logging.error('error while creating imagestreamtag: ' + sshSession.getBefore())
return False
def _start_build(self, sshSession, name):
......@@ -125,7 +134,7 @@ class Cluster:
while timeout_sec > 0:
# check status
for j in jobs:
sshSession.command(f'oc get pods | grep {j}', '\$', 5, silent = True)
sshSession.command(f'oc get pods | grep {j}', '\$', 10, silent = True)
if sshSession.getBefore().count('Completed') > 0: jobs.remove(j)
if sshSession.getBefore().count('Error') > 0:
logging.error(f'error for job {j}: ' + sshSession.getBefore())
......@@ -141,18 +150,6 @@ class Cluster:
def _retag_image_statement(self, sshSession, oldImage, newImage, newTag, filename):
sshSession.command(f'sed -i -e "s#{oldImage}:latest#{newImage}:{newTag}#" {filename}', '\$', 5)
def _pull_image(self, sshSession, image, tag):
sshSession.command(f'oc whoami -t | sudo podman login -u oaicicd --password-stdin https://{self.OCRegistry} --tls-verify=false', '\$', 5, silent=True)
if sshSession.getBefore().count('Login Succeeded!') == 0:
return None
imageName = f'{self.OCRegistry}{self.OCProjectName}/{image}:{tag}'
sshSession.command(f'sudo podman pull {imageName} --tls-verify=false', '\$', 300)
pullResult = sshSession.getBefore()
sshSession.command(f'sudo podman logout https://{self.OCRegistry}', '\$', 10, silent=True)
if pullResult.count('Storing signatures') == 0:
return None
return imageName
def _get_image_size(self, sshSession, image, tag):
# get the SHA of the image we built using the image name and its tag
sshSession.command(f'oc describe is {image} | grep -A4 {tag}', '\$', 5)
......@@ -216,7 +213,7 @@ class Cluster:
# Workaround for some servers, we need to erase completely the workspace
if self.forcedWorkspaceCleanup:
mySSH.command(f'sudo rm -Rf {lSourcePath}', '\$', 15)
mySSH.command(f'rm -Rf {lSourcePath}', '\$', 15)
cls_containerize.CreateWorkspace(mySSH, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge)
# we don't necessarily need a forced workspace cleanup, but in
......@@ -259,7 +256,7 @@ class Cluster:
status = True # flag to abandon compiling if any image fails
attemptedImages = []
if forceBaseImageBuild:
self._recreate_is(mySSH, 'ran-base', baseTag, 'openshift/ran-base-is.yaml')
self._recreate_is_tag(mySSH, 'ran-base', baseTag, 'openshift/ran-base-is.yaml')
self._recreate_bc(mySSH, 'ran-base', baseTag, 'openshift/ran-base-bc.yaml')
ranbase_job = self._start_build(mySSH, 'ran-base')
attemptedImages += ['ran-base']
......@@ -277,13 +274,13 @@ class Cluster:
status = False
if status:
self._recreate_is(mySSH, 'oai-physim', imageTag, 'openshift/oai-physim-is.yaml')
self._recreate_is_tag(mySSH, 'oai-physim', imageTag, 'openshift/oai-physim-is.yaml')
self._recreate_bc(mySSH, 'oai-physim', imageTag, 'openshift/oai-physim-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.phySim.rhel8.2')
physim_job = self._start_build(mySSH, 'oai-physim')
attemptedImages += ['oai-physim']
self._recreate_is(mySSH, 'ran-build', imageTag, 'openshift/ran-build-is.yaml')
self._recreate_is_tag(mySSH, 'ran-build', imageTag, 'openshift/ran-build-is.yaml')
self._recreate_bc(mySSH, 'ran-build', imageTag, 'openshift/ran-build-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.build.rhel8.2')
ranbuild_job = self._start_build(mySSH, 'ran-build')
......@@ -296,28 +293,28 @@ class Cluster:
mySSH.command(f'oc logs {physim_job} > cmake_targets/log/oai-physim.log', '\$', 10)
if status:
self._recreate_is(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-is.yaml')
self._recreate_is_tag(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-is.yaml')
self._recreate_bc(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.eNB.rhel8.2')
self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.eNB.rhel8.2')
enb_job = self._start_build(mySSH, 'oai-enb')
attemptedImages += ['oai-enb']
self._recreate_is(mySSH, 'oai-gnb', imageTag, 'openshift/oai-gnb-is.yaml')
self._recreate_is_tag(mySSH, 'oai-gnb', imageTag, 'openshift/oai-gnb-is.yaml')
self._recreate_bc(mySSH, 'oai-gnb', imageTag, 'openshift/oai-gnb-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.gNB.rhel8.2')
self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.gNB.rhel8.2')
gnb_job = self._start_build(mySSH, 'oai-gnb')
attemptedImages += ['oai-gnb']
self._recreate_is(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-is.yaml')
self._recreate_is_tag(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-is.yaml')
self._recreate_bc(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.lteUE.rhel8.2')
self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.lteUE.rhel8.2')
lteue_job = self._start_build(mySSH, 'oai-lte-ue')
attemptedImages += ['oai-lte-ue']
self._recreate_is(mySSH, 'oai-nr-ue', imageTag, 'openshift/oai-nr-ue-is.yaml')
self._recreate_is_tag(mySSH, 'oai-nr-ue', imageTag, 'openshift/oai-nr-ue-is.yaml')
self._recreate_bc(mySSH, 'oai-nr-ue', imageTag, 'openshift/oai-nr-ue-bc.yaml')
self._retag_image_statement(mySSH, 'ran-base', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-base', baseTag, 'docker/Dockerfile.nrUE.rhel8.2')
self._retag_image_statement(mySSH, 'ran-build', 'image-registry.openshift-image-registry.svc:5000/oaicicd-ran/ran-build', imageTag, 'docker/Dockerfile.nrUE.rhel8.2')
......@@ -348,6 +345,9 @@ class Cluster:
imageSize[image] = f'{sizeMb:.1f} Mbytes (uncompressed: ~{sizeMb*2.5:.1f} Mbytes)'
logging.info(f'\u001B[1m{image} size is {imageSize[image]}\u001B[0m')
grep_exp = "\|".join(attemptedImages)
mySSH.command(f'oc get images | grep -e \'{grep_exp}\' > cmake_targets/log/image_registry.log', '\$', 10);
build_log_name = f'build_log_{self.testCase_id}'
cls_containerize.CopyLogsToExecutor(mySSH, lSourcePath, build_log_name, lIpAddr, 'oaicicd', CONST.CI_NO_PASSWORD)
......
......@@ -67,7 +67,7 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge
sshSession.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
sshSession.command('git config user.name "OAI Jenkins"', '\$', 5)
sshSession.command('sudo git clean -x -d -ff', '\$', 30)
sshSession.command('git clean -x -d -ff', '\$', 30)
sshSession.command('mkdir -p cmake_targets/log', '\$', 5)
# if the commit ID is provided use it to point to it
if ranCommitID != '':
......
......@@ -283,7 +283,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil = pilot + idxDC / 2 - 1;
ul_ch += idxDC - 2 ;
ul_ch = memset(ul_ch, 0, sizeof(*ul_ch)*5);
re_offset = (re_offset+idxDC-1) % symbolSize;
re_offset = (re_offset + idxDC - 2) % symbolSize;
const c16_t ch=c16mulShift(*pil,
rxdataF[soffset+nushift+re_offset],
15);
......
......@@ -12,6 +12,8 @@
</tr>
</table>
[[_TOC_]]
# 1. Introduction
## General
......@@ -119,13 +121,14 @@ The `<image>` could be `oai-gnb`, and the `<tag>` `ci-temp`.
# 6. Deployment using HELM Charts
**CAUTION: even more experimental.**
Helm charts are located in another repository:
Helm charts are located under `charts`. Assuming that the image is in the image
registry, the physims could be deployed as shown in the following steps:
```bash
git clone https://github.com/OPENAIRINTERFACE/openair-k8s.git
cd openair-k8s
git checkout helm-deployment-S6a-S1C-S1U-in-network-18-with-enb
helm install mme /path-to-your-cloned/openair-k8s/charts/oai-mme/
grep -rl OAICICD_PROJECT ./charts/ | xargs sed -i -e "s#OAICICD_PROJECT#oaicicd-ran#" # select the correct project
sed -i -e "s#TAG#ci-temp#g" ./charts/physims/values.yaml # select the correct tag
helm install physim ./charts/physims/ # deploy
oc get pods # get the list of deployed containers
oc logs <pod> # inspect the logs of a pod
helm uninstall physim # undeploy
```
......@@ -28,5 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -28,6 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -28,5 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -28,5 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -28,5 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -27,5 +27,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
......@@ -28,6 +28,3 @@ metadata:
spec:
lookupPolicy:
local: true
status:
tag: latest
#!/bin/bash
# generate .c and .h files
which asn1c > /dev/null
if [ $? -eq 0 ] ; then echo "asn1c is installed" ; else echo "Please install asn1c (version 0.9.22 or greater)" ; fi
cd $OPENAIR2_DIR/RRC/LITE/MESSAGES && asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions.asn
# generate ASN constants
rm -f $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.h
cat $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions.asn | grep INTEGER\ \:\: | sed 's/INTEGER ::=//g' | sed 's/--/\/\//g' | sed 's/^/#define /' | sed 's/\-1/_minus_1/g' | sed 's/\-/_/g' > $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.tmp
rm -f /tmp/EUTRA-RRC-Definitions.tmp
cat $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions.asn | grep --invert-match SEQUENCE | grep INTEGER\ \( | uniq | grep \:\:\= | sed 's/INTEGER\ //g' | sed 's/[()]//g' | tr "." " " | sed 's/\:\:\=//g' | tr '\t' " " > /tmp/EUTRA-RRC-Definitions.tmp
cat /tmp/EUTRA-RRC-Definitions.tmp | sed 's/^ *//g' | sed 's/ \{1,\}/ /g' | cut --complement -d ' ' -f3 | sed 's/^/#define min_val_/' | sed 's/\ -/\ +/g' | sed 's/-/_/g' | sed 's/\ +/\ -/g' >> $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.tmp
cat /tmp/EUTRA-RRC-Definitions.tmp | sed 's/^ *//g' | sed 's/ \{1,\}/ /g' | cut --complement -d ' ' -f2 | sed 's/^/#define max_val_/' | sed 's/\ -/\ +/g' | sed 's/-/_/g' | sed 's/\ +/\ -/g' >> $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.tmp;
echo "#ifndef __ASN1_CONSTANTS_H__" > $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.h
echo "#define __ASN1_CONSTANTS_H__" >> $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.h
cat $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.tmp >> $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.h
echo "#endif " >> $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.h
rm -f $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1_constants.tmp;
#!/bin/bash
which asn1c > /dev/null
if [ $? -eq 0 ] ; then echo "asn1c is installed" ; else echo "Please install asn1c (version 0.9.22 or greater)" ; fi
cd $OPENAIR2_DIR/RRC/LITE/MESSAGES && asn1c -gen-PER -fcompound-names -fnative-types -fskeletons-copy $OPENAIR2_DIR/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions.asn
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
################################################################################
# Tested on ubuntu 12.04 with updates 07 november 2013
$1 rm -Rf /usr/local/src/asn1c-r1516
$1 svn co https://github.com/vlm/asn1c/trunk /usr/local/src/asn1c-r1516 -r 1516 > /tmp/install_log.txt
cd /usr/local/src/asn1c-r1516
$1 patch -p0 < $OPENAIR3_DIR/S1AP/MESSAGES/ASN1/asn1cpatch.p0 > /tmp/install_log.txt
$1 ./configure > /tmp/install_log.txt
$1 make > /tmp/install_log.txt
$1 make install > /tmp/install_log.txt
#!/usr/bin/env python
# svn merge-tool python wrapper for meld
# to use: edit ~/.subversion/config and uncomment the line merge-tool-cmd =
# and set the path to your command
# Note that when a conflict occurs, you will be prompted what to do with it. You need to type a single 'l' and for svn to run this script. When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy.
import os, sys
import subprocess
import shutil
try:
# path to meld
meld = "/usr/bin/meld"
print "Set the file paths for mine, theirs, and merged\n"
print "When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy\n"
# the base or "left" revision version of the file you're merging with
base = sys.argv[1]
# this is "later" or "right"revision version of the file you're merging with
theirs = sys.argv[2]
# this is my version, recommandations: sync your copy to the latest version
mine = sys.argv[3]
#this starts out as a copy of 'mine' (your working copy), and this is where you want the final results of the merge to end up.
merged = sys.argv[4]
print "Calling meld: the order of the files is (merged, theirs, and mine)"
# all 4 versions: worke right-to-left, reslut being stored in the left file
# cmd = [meld, mine, base, theirs, merged]
# only 3 versions
cmd = [meld, merged, theirs, mine]
# Call meld, making sure it exits correctly
subprocess.check_call(cmd)
except:
print "Oh, an error!\n"
sys.exit(-1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment