-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding OAI RAN and UE test deployment scripts #227
Merged
+271
−3
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
11a3cbb
Changes to add ue and ran deployment scripts
josephthaliath 8d1ba39
changes to repo register and name corrections
josephthaliath beb6bda
changes to file permissions
josephthaliath 0038540
Some OAI RAN fixes
electrocucaracha c149587
Merge pull request #1 from electrocucaracha/004_005
josephthaliath a569dd0
remove private catalog repository reference
josephthaliath 9cb1e2c
Changes to correct scripts to work on different setups
josephthaliath ce89543
Change repo name in 002-oai-operators.yaml
josephthaliath d7014ea
Update repo in 004-ran-cucp.yaml
josephthaliath 0693dc6
Update year in 004-ran-cucp.yaml
josephthaliath eea8817
year update in 004.sh
josephthaliath 6d27a31
Update repo information in 004.sh
josephthaliath 9bca1ac
update year in 005.sh
josephthaliath 60ff743
Update repo in 005.sh
josephthaliath f52ea9e
Merge branch 'nephio-project:main' into main
josephthaliath 07783a0
changes to deploy ran operator only in regional and edge cluster
josephthaliath 55642c8
Corrections to package variant names
josephthaliath 5395549
removing the file added by mistake
josephthaliath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-cucp | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-cucp-bp | ||
revision: main | ||
downstream: | ||
repo: regional | ||
package: oai-ran-cucp | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: regional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
## TEST METADATA | ||
## TEST-NAME: Deploy OAI E1 Split RAN Network Functions | ||
## | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
[[ ${DEBUG:-false} != "true" ]] || set -o xtrace | ||
|
||
# shellcheck source=e2e/defaults.env | ||
source "$E2EDIR/defaults.env" | ||
|
||
# shellcheck source=e2e/lib/k8s.sh | ||
source "${LIBDIR}/k8s.sh" | ||
|
||
# shellcheck source=e2e/lib/kpt.sh | ||
source "${LIBDIR}/kpt.sh" | ||
|
||
function _wait_for_ran { | ||
kubeconfig=$1 | ||
wait_msg=$2 | ||
link_name=$3 | ||
|
||
info "waiting for $link_name link to be established" | ||
timeout=600 | ||
|
||
temp_file=$(mktemp) | ||
kubectl logs "$(kubectl get pods -n oai-ran-cucp --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-gnb-cu-cp -o jsonpath='{.items[*].metadata.name}')" -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" > temp_file | ||
while grep -q "$wait_msg" temp_file;status=$?; [[ $status != 0 ]] | ||
do | ||
if [[ $timeout -lt 0 ]]; then | ||
kubectl logs -l app.kubernetes.io/name=oai-gnb-cu-cp -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" --tail 50 | ||
error "Timed out waiting for $link_name link to be established" | ||
fi | ||
timeout=$((timeout - 5)) | ||
sleep 5 | ||
kubectl logs "$(kubectl get pods -n oai-ran-cucp --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-gnb-cu-cp -o jsonpath='{.items[*].metadata.name}')" -n oai-ran-cucp -c gnbcucp --kubeconfig "$kubeconfig" > temp_file | ||
done | ||
debug "timeout: $timeout" | ||
rm "${temp_file}" | ||
} | ||
|
||
function _wait_for_n2_link { | ||
_wait_for_ran "$1" "Received NGAP_REGISTER_GNB_CNF: associated AMF" "N2" | ||
} | ||
|
||
function _wait_for_e1_link { | ||
# Connection between CU-CP and CU-UP | ||
_wait_for_ran "$1" "e1ap_send_SETUP_RESPONSE" "E1" | ||
} | ||
|
||
function _wait_for_f1_link { | ||
# Connection between DU and CU-CP | ||
_wait_for_ran "$1" "Cell Configuration ok" "F1" | ||
} | ||
|
||
k8s_apply "$TESTDIR/004-ran-cucp.yaml" | ||
|
||
for nf in du cuup; do | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-$nf | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-$nf-bp | ||
revision: main | ||
downstream: | ||
repo: edge | ||
package: oai-ran-$nf | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: edge | ||
EOF | ||
done | ||
|
||
for nf in du cuup cucp; do | ||
k8s_wait_ready "packagevariant" "oai-$nf" | ||
done | ||
|
||
for nf in du cuup; do | ||
kpt_wait_pkg "edge" "oai-ran-$nf" "nephio" "1800" | ||
done | ||
kpt_wait_pkg "regional" "oai-ran-cucp" "nephio" "1800" | ||
|
||
_regional_kubeconfig="$(k8s_get_capi_kubeconfig "regional")" | ||
_edge_kubeconfig="$(k8s_get_capi_kubeconfig "edge")" | ||
|
||
k8s_wait_ready_replicas "deployment" "oai-gnb-cu-cp" "$_regional_kubeconfig" "oai-ran-cucp" | ||
k8s_wait_ready_replicas "deployment" "oai-gnb-cu-up" "$_edge_kubeconfig" "oai-ran-cuup" | ||
k8s_wait_ready_replicas "deployment" "oai-gnb-du" "$_edge_kubeconfig" "oai-ran-du" | ||
|
||
# Check if the NGAPSetup Request Response is okay between AMF and CU-CP | ||
_wait_for_n2_link "$_regional_kubeconfig" | ||
# Check if the E1Setup Request Response is okay between AMF and CU-CP | ||
_wait_for_e1_link "$_regional_kubeconfig" | ||
# Check if the F1Setup Request Response is okay between AMF and CU-CP | ||
_wait_for_f1_link "$_regional_kubeconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
# SPDX-license-identifier: Apache-2.0 | ||
############################################################################## | ||
# Copyright (c) 2024 The Nephio Authors. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Apache License, Version 2.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
############################################################################## | ||
|
||
## TEST METADATA | ||
## TEST-NAME: Deploy OAI UE SIM | ||
## | ||
|
||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
[[ ${DEBUG:-false} != "true" ]] || set -o xtrace | ||
|
||
# shellcheck source=e2e/defaults.env | ||
source "$E2EDIR/defaults.env" | ||
|
||
# shellcheck source=e2e/lib/k8s.sh | ||
source "${LIBDIR}/k8s.sh" | ||
|
||
# shellcheck source=e2e/lib/kpt.sh | ||
source "${LIBDIR}/kpt.sh" | ||
|
||
function _wait_for_ue { | ||
local kubeconfig=$1 | ||
local log_msg=$2 | ||
local msg=$3 | ||
|
||
info "waiting for $msg to be finished" | ||
timeout=600 | ||
temp_file=$(mktemp) | ||
kubectl logs "$(kubectl get pods -n oai-ue --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-nr-ue -o jsonpath='{.items[*].metadata.name}')" -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" > temp_file | ||
while grep -q "$log_msg" temp_file;status=$?; [ $status != 0 ] | ||
do | ||
if [[ $timeout -lt 0 ]]; then | ||
kubectl logs -l app.kubernetes.io/name=oai-nr-ue -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" --tail 50 | ||
error "Timed out waiting for $msg" | ||
fi | ||
timeout=$((timeout - 5)) | ||
sleep 5 | ||
kubectl logs "$(kubectl get pods -n oai-ue --kubeconfig "$kubeconfig" -l app.kubernetes.io/name=oai-nr-ue -o jsonpath='{.items[*].metadata.name}')" -n oai-ue -c nr-ue --kubeconfig "$kubeconfig" > temp_file | ||
done | ||
debug "timeout: $timeout" | ||
rm "${temp_file}" | ||
} | ||
|
||
function _wait_for_ue_registration { | ||
_wait_for_ue "$1" "REGISTRATION ACCEPT" "UE Registration" | ||
} | ||
|
||
function _wait_for_ue_pdu_session { | ||
_wait_for_ue "$1" "Interface oaitun_ue1 successfully configured" "PDU session" | ||
} | ||
|
||
cat <<EOF | kubectl apply -f - | ||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: PackageVariant | ||
metadata: | ||
name: oai-ue | ||
spec: | ||
upstream: | ||
repo: catalog-workloads-oai-ran | ||
package: pkg-example-ue-bp | ||
revision: main | ||
downstream: | ||
repo: edge | ||
package: oai-ran-ue | ||
annotations: | ||
approval.nephio.org/policy: initial | ||
injectors: | ||
- name: edge | ||
EOF | ||
|
||
k8s_wait_ready "packagevariant" "oai-ue" | ||
kpt_wait_pkg "edge" "oai-ran-ue" "nephio" "1800" | ||
|
||
_edge_kubeconfig="$(k8s_get_capi_kubeconfig "edge")" | ||
k8s_wait_ready_replicas "deployment" "oai-nr-ue" "$_edge_kubeconfig" "oai-ue" | ||
|
||
# Check if the Registration is finished | ||
_wait_for_ue_registration "$_edge_kubeconfig" | ||
# Check if the PDU Session is setup | ||
_wait_for_ue_pdu_session "$_edge_kubeconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/e2e/tests/oai/002.sh b/e2e/tests/oai/002.sh | ||
index a334090..6e7f6e0 100755 | ||
--- a/e2e/tests/oai/002.sh | ||
+++ b/e2e/tests/oai/002.sh | ||
@@ -29,7 +29,7 @@ source "${LIBDIR}/kpt.sh" | ||
|
||
k8s_apply "$TESTDIR/002-oai-operators.yaml" | ||
|
||
-for pkgvar in common-core-database cp-operators up-operators ran-operator-edge-oai-ran-operator ran-operator-regional-oai-ran-operator; do | ||
+for pkgvar in common-core-database cp-operators up-operators ran-operator-edge ran-operator-regional; do | ||
k8s_wait_ready "packagevariant" "oai-$pkgvar" | ||
done | ||
kpt_wait_pkg "core" "database" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josephthaliath I don't think this file is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arora-sagar . Thanks. added by mistake. removed it.