Skip to content
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

Test script for kubernetes #35

Closed
infinitydon opened this issue May 1, 2020 · 12 comments
Closed

Test script for kubernetes #35

infinitydon opened this issue May 1, 2020 · 12 comments
Labels
question Further information is requested

Comments

@infinitydon
Copy link

Hi,

I was able to deploy the v3.0.1 in a kubernetes cluster using sdnvortex/network-controller to simulate multiple network interfaces (currently with one worker node).

NAME                                       READY   STATUS    RESTARTS   AGE
free5gc-amf-deployment-66744dbc4f-p89z6    1/1     Running   0          64m
free5gc-ausf-deployment-6589ddd96f-jqm5j   1/1     Running   0          62m
free5gc-mongodb-0                          2/2     Running   0          69m
free5gc-nrf-deployment-656b465db8-6trw7    1/1     Running   0          65m
free5gc-nssf-deployment-5bcdf56fc-26kj4    1/1     Running   0          61m
free5gc-pcf-deployment-759479f9bb-m45pv    1/1     Running   0          62m
free5gc-smf-deployment-8d46888f4-q2d4n     1/1     Running   0          2m22s
free5gc-udm-deployment-694749d586-wf4tf    1/1     Running   0          61m
free5gc-udr-deployment-765bcf5d8f-fzz95    1/1     Running   0          7m24s
free5gc-upf-deployment-589ffdb69f-5rhrd    1/1     Running   0          46m

I think the current test script assumes that all the components are installed in the same system

Any ideas how to modify the test script to test if the 5GC components are running properly (maybe a k8s job)? Most especially because each of the components are running in different PODs.

@free5gc-org
Copy link
Contributor

Hi,

For our test script, it's just check if we have install the all-in-one free5GC successfully. Because we are not implementing RAN and UE parted, most of the procedure of RAN and UE is hard code in test script. If you have different IP setting for cluster architecture, you may need to change the IP that are hard code inside test script.
Or the better way may be using a ran simulator to test it.

If you want to modify the test script, basically you can check src/test/registration_test.go and change the IP there.

@free5gc-org free5gc-org added the question Further information is requested label May 1, 2020
@infinitydon
Copy link
Author

Thanks for the quick response, I think Ii prefer the option of using a simulator, in the past I used Openairtinterface to simulate 4G ue/enb but if anyone has an alternative 5G opensource simulator in mind should kindly let me know.

@sothy
Copy link

sothy commented May 8, 2020

@infinitydon I made small test tool based on free5GC registration test file. Please feel to add
https://bitbucket.org/sothy5/gnbsim/src/dev/

@infinitydon
Copy link
Author

@sothy Much thanks for this effort! I have checked the repo but how can I initiate a basic test? I could not find information on this.

@sothy
Copy link

sothy commented May 8, 2020

@infinitydon I didnt test well, if you compile and run, it should work.
go build main.go
./main
or go run main.go

@infinitydon
Copy link
Author

@sothy - I am getting some dependency errors:

reg/registration.go:6:2: cannot find package "github.com/free5gc/CommonConsumerTestData/UDM/TestGenAuthData" in any of:
        /usr/local/go/src/github.com/free5gc/CommonConsumerTestData/UDM/TestGenAuthData (from $GOROOT)
        /go/src/github.com/free5gc/CommonConsumerTestData/UDM/TestGenAuthData (from $GOPATH)
reg/registration.go:7:2: cannot find package "github.com/free5gc/CommonConsumerTestData/UDR/TestRegistrationProcedure" in any of:
        /usr/local/go/src/github.com/free5gc/CommonConsumerTestData/UDR/TestRegistrationProcedure (from $GOROOT)
        /go/src/github.com/free5gc/CommonConsumerTestData/UDR/TestRegistrationProcedure (from $GOPATH)
util/db/mangodb.go:6:2: cannot find package "github.com/free5gc/MongoDBLibrary" in any of:
        /usr/local/go/src/github.com/free5gc/MongoDBLibrary (from $GOROOT)
        /go/src/github.com/free5gc/MongoDBLibrary (from $GOPATH)
ran/ran_ue_context.go:7:2: cannot find package "github.com/free5gc/UeauCommon" in any of:
        /usr/local/go/src/github.com/free5gc/UeauCommon (from $GOROOT)
        /go/src/github.com/free5gc/UeauCommon (from $GOPATH)
ngap/build.go:6:2: cannot find package "github.com/free5gc/aper" in any of:
        /usr/local/go/src/github.com/free5gc/aper (from $GOROOT)
        /go/src/github.com/free5gc/aper (from $GOPATH)
ran/ran_ue_context.go:8:2: cannot find package "github.com/free5gc/milenage" in any of:
        /usr/local/go/src/github.com/free5gc/milenage (from $GOROOT)
        /go/src/github.com/free5gc/milenage (from $GOPATH)
ran/nas_helper.go:6:2: cannot find package "github.com/free5gc/nas" in any of:
        /usr/local/go/src/github.com/free5gc/nas (from $GOROOT)
        /go/src/github.com/free5gc/nas (from $GOPATH)
ran/nas_helper.go:7:2: cannot find package "github.com/free5gc/nas/nasMessage" in any of:
        /usr/local/go/src/github.com/free5gc/nas/nasMessage (from $GOROOT)
        /go/src/github.com/free5gc/nas/nasMessage (from $GOPATH)
reg/registration.go:12:2: cannot find package "github.com/free5gc/nas/nasTestpacket" in any of:
        /usr/local/go/src/github.com/free5gc/nas/nasTestpacket (from $GOROOT)
        /go/src/github.com/free5gc/nas/nasTestpacket (from $GOPATH)
reg/registration.go:13:2: cannot find package "github.com/free5gc/nas/nasType" in any of:
        /usr/local/go/src/github.com/free5gc/nas/nasType (from $GOROOT)
        /go/src/github.com/free5gc/nas/nasType (from $GOPATH)
ran/nas_helper.go:8:2: cannot find package "github.com/free5gc/ngap" in any of:
        /usr/local/go/src/github.com/free5gc/ngap (from $GOROOT)
        /go/src/github.com/free5gc/ngap (from $GOPATH)
ngap/build.go:7:2: cannot find package "github.com/free5gc/ngap/ngapConvert" in any of:
        /usr/local/go/src/github.com/free5gc/ngap/ngapConvert (from $GOROOT)
        /go/src/github.com/free5gc/ngap/ngapConvert (from $GOPATH)
ngap/build.go:8:2: cannot find package "github.com/free5gc/ngap/ngapType" in any of:
        /usr/local/go/src/github.com/free5gc/ngap/ngapType (from $GOROOT)
        /go/src/github.com/free5gc/ngap/ngapType (from $GOPATH)
ran/ran_ue_context.go:9:2: cannot find package "github.com/free5gc/openapi/models" in any of:
        /usr/local/go/src/github.com/free5gc/openapi/models (from $GOROOT)
        /go/src/github.com/free5gc/openapi/models (from $GOPATH)
util/amf.go:8:2: cannot find package "github.com/ishidawataru/sctp" in any of:
        /usr/local/go/src/github.com/ishidawataru/sctp (from $GOROOT)
        /go/src/github.com/ishidawataru/sctp (from $GOPATH)

Can you give a step by step guide on how to build this?

Also I checked https://bitbucket.org/sothy5/gnbsim/src/dev/reg/registration.go, seems I need to edit the following parameters that is inside the file:

const (
	RANIPAddress = "127.0.0.1"
	AMFIPAddress = "127.0.0.1"
	RANSCTPPort  = 38412
	AMFSCTPPort  = 9487

	UDPDPPort = 2152
)

Please note that I am running the 5G components in individual PODs (i.e. not localhost), how can I configure your simulator in an environment like kubernetes?

NAME                                       READY   STATUS    RESTARTS   AGE
free5gc-amf-deployment-66744dbc4f-ndhqw    1/1     Running   0          13h
free5gc-ausf-deployment-6589ddd96f-rm6k5   1/1     Running   0          13h
free5gc-mongodb-0                          2/2     Running   0          13h
free5gc-nrf-deployment-656b465db8-k2whf    1/1     Running   0          13h
free5gc-nssf-deployment-5bcdf56fc-t65cp    1/1     Running   0          13h
free5gc-pcf-deployment-759479f9bb-pjg2l    1/1     Running   0          13h
free5gc-smf-deployment-8d46888f4-tfwz4     1/1     Running   0          13h
free5gc-udm-deployment-694749d586-z22hr    1/1     Running   0          13h
free5gc-udr-deployment-765bcf5d8f-s9nkp    1/1     Running   0          13h
free5gc-upf-deployment-589ffdb69f-8ksq2    1/1     Running   0          13h
free5gc-webui-deployment-c56dfdfc-6xc9g    1/1     Running   0          70m

@sothy
Copy link

sothy commented May 13, 2020

@infinitydon quick answer is that you have to download one by one all dependency. For example,
go get github.com/free5gc/CommonConsumerTestData/UDM/TestGenAuthData

In my setup, I tried to activate go mod and tries to compile.
It gives me error. I dont know why?
build command-line-arguments: cannot load free5gc/lib/MongoDBLibrary/logger: cannot find module providing package free5gc/lib/MongoDBLibrary/logger`

I dont know who is looking for this package. Do you have any place how do you create these pods in kubernetes? It means configuration files?

Free5gc is still using lib folder. It is not easy. Will see

@infinitydon
Copy link
Author

In kubernetes each 5G function has it's own service IP address like:

AMF - 192.168.2.2
SMF - 192.168.2.3
NRF - 192.168.2.5
AUSF - 192.168.2.4
NSSF - 192.168.2.6
UDM - 192.168.2.7
UDR - 192.168.2.8
UPF - 192.168.2.10
PCF - 192.168.2.9

Unfortunately I don't know much about the golang libraries.

@infinitydon
Copy link
Author

@sothy I think you need to update the dependency path because most of the free5gc component/libraries are now in their separate repos. See the screenshot below:

image

Maybe you might follow the way free5gc uses submodules in compiling (see the documentation).

@sothy
Copy link

sothy commented May 14, 2020

@infinitydon I dont use this way. I used golang way. It got failed. NO idea. Otherwise, I have to work this manner

Update: When I add GO11Module=off, it is compiled. Better you should have lib and let me know.
It is compiled or not

@endrigoshi
Copy link

I think it is fixed if you just do the following after cloning the repository:

git submodule init
git submodule update

Then the compilation should be okay as you will get all the libraries necessary.

free5gc-org pushed a commit that referenced this issue Jan 18, 2021
@liyinxin
Copy link

Hi, can you tell me how to create a cluster with k8s for the free5gc?
Thanks very much!

eric5800602 pushed a commit to eric5800602/free5gc that referenced this issue Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants