本文主要是介绍oai调试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、修改docker-compose脚本
entrypoint: ["/bin/sh", "-c", "while true; do echo 'Hello World'; sleep 1; done"]
oai-upf:container_name: "oai-upf"image: oaisoftwarealliance/oai-upf:v2.0.1### 修改entrypoint entrypoint: ["/bin/sh", "-c", "while true; do echo 'Hello World'; sleep 100000; done"]expose:- 2152/udp- 8805/udpvolumes:- ./conf/basic_nrf_config.yaml:/openair-upf/etc/config.yamlenvironment:- TZ=Europe/Parisdepends_on:- oai-nrf- oai-smfcap_add:- NET_ADMIN- SYS_ADMINcap_drop:- ALLprivileged: truenetworks:public_net:ipv4_address: 192.168.70.134
2、docker inspect镜像
2.1 docker images
hzf@hzf:~/oai/oai-cn5g-fed/docker-compose$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 8.0 a6a15556a7dd 3 weeks ago 603MB
oaisoftwarealliance/trf-gen-cn5g latest ea2401730c48 2 months ago 274MB
oaisoftwarealliance/oai-udm v2.0.1 9a1a314dfa0b 2 months ago 134MB
oaisoftwarealliance/oai-udr v2.0.1 c7dbb567d5a5 2 months ago 146MB
oaisoftwarealliance/oai-smf v2.0.1 8db2f629a81e 2 months ago 145MB
oaisoftwarealliance/oai-amf v2.0.1 af553c2d6af8 2 months ago 157MB
oaisoftwarealliance/oai-upf v2.0.1 d2979dd67d1e 4 months ago 145MB
oaisoftwarealliance/oai-nrf v2.0.1 df540f765a91 4 months ago 137MB
oaisoftwarealliance/oai-ausf v2.0.1 e0962847397b 4 months ago 132MB
hello-world latest d2c94e258dcb 11 months ago 13.3kB
hzf@hzf:~/oai/oai-cn5g-fed/docker-compose$
2.2 docker inspect 镜像
hzf@hzf:~/oai/oai-cn5g-fed/docker-compose$ docker inspect d2979dd67d1e
[
{
"Id": "sha256:d2979dd67d1ef5bc70bffbac5668936047c3e4f45556222b54b6f73de743fcc1",
"RepoTags": [
"oaisoftwarealliance/oai-upf:v2.0.1"
],
"RepoDigests": [
"oaisoftwarealliance/oai-upf@sha256:ed69524b00b09d141a06ce985cfb0dfd3c0d725b637dddc64c8b7a72a67c7efb"
],
"Parent": "",
"Comment": "Imported from -",
"Created": "2023-12-14T14:21:15.45474876Z",
"DockerVersion": "20.10.18",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"2152/udp": {},
"8805/udp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/openair-upf/bin/oai_upf",
"-c",
"/openair-upf/etc/config.yaml",
"-o"
],
"Healthcheck": {
"Test": [
"CMD-SHELL",
"/openair-upf/bin/healthcheck.sh"
],
"Interval": 10000000000,
"Timeout": 15000000000,
"Retries": 6
},
"Image": "",
"Volumes": null,
"WorkingDir": "/openair-upf",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"support-multi-sgwu-instances": "true",
"support-nrf-fdqn": "true"
}
},
"Architecture": "amd64",
"Os": "linux",
"Size": 144888929,
"GraphDriver": {
"Data": {
"MergedDir": "/var/lib/docker/overlay2/ab816371bfe6cf69ce7f2f33bb9c0990d23271f285cc8f23c6577f239de72240/merged",
"UpperDir": "/var/lib/docker/overlay2/ab816371bfe6cf69ce7f2f33bb9c0990d23271f285cc8f23c6577f239de72240/diff",
"WorkDir": "/var/lib/docker/overlay2/ab816371bfe6cf69ce7f2f33bb9c0990d23271f285cc8f23c6577f239de72240/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:900731ecf597d4fb61385afa6a23fc76af82b4576499dbc984d9ea64905914e9"
]
},
"Metadata": {
"LastTagTime": "0001-01-01T00:00:00Z"
}
}
]
hzf@hzf:~/oai/oai-cn5g-fed/docker-compose$
2.3 docker inspect 容器
hzf@hzf:~/oai/oai-cn5g-fed$ docker inspect f4ed3f418e12
[
{
"Id": "f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1",
"Created": "2024-04-21T04:32:07.784682725Z",
"Path": "/openair-upf/bin/oai_upf",
"Args": [
"-c",
"/openair-upf/etc/config.yaml",
"-o"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 1,
"Error": "",
"StartedAt": "2024-04-21T04:32:13.8970516Z",
"FinishedAt": "2024-04-21T04:32:14.182414554Z",
"Health": {
"Status": "unhealthy",
"FailingStreak": 0,
"Log": []
}
},
"Image": "sha256:d2979dd67d1ef5bc70bffbac5668936047c3e4f45556222b54b6f73de743fcc1",
"ResolvConfPath": "/var/lib/docker/containers/f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1/hostname",
"HostsPath": "/var/lib/docker/containers/f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1/hosts",
"LogPath": "/var/lib/docker/containers/f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1/f4ed3f418e120b6a08913b221764c3afc94779dab836ae7fce45152cc9af70e1-json.log",
"Name": "/oai-upf",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "unconfined",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/home/hzf/oai/oai-cn5g-fed/docker-compose/conf/basic_nrf_config.yaml:/openair-upf/etc/config.yaml:rw"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "demo-oai-public-net",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": [
"NET_ADMIN",
"SYS_ADMIN"
],
"CapDrop": [
"ALL"
],
"CgroupnsMode": "host",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": [],
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/736b1e41d51ee1c61eb5382c97ec24e80d3ae75c0288a12760c77315d673d6b8-init/diff:/var/lib/docker/overlay2/ab816371bfe6cf69ce7f2f33bb9c0990d23271f285cc8f23c6577f239de72240/diff",
"MergedDir": "/var/lib/docker/overlay2/736b1e41d51ee1c61eb5382c97ec24e80d3ae75c0288a12760c77315d673d6b8/merged",
"UpperDir": "/var/lib/docker/overlay2/736b1e41d51ee1c61eb5382c97ec24e80d3ae75c0288a12760c77315d673d6b8/diff",
"WorkDir": "/var/lib/docker/overlay2/736b1e41d51ee1c61eb5382c97ec24e80d3ae75c0288a12760c77315d673d6b8/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/home/hzf/oai/oai-cn5g-fed/docker-compose/conf/basic_nrf_config.yaml",
"Destination": "/openair-upf/etc/config.yaml",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "f4ed3f418e12",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"2152/udp": {},
"8805/udp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"TZ=Europe/Paris",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/openair-upf/bin/oai_upf",
"-c",
"/openair-upf/etc/config.yaml",
"-o"
],
"Healthcheck": {
"Test": [
"CMD-SHELL",
"/openair-upf/bin/healthcheck.sh"
],
"Interval": 10000000000,
"Timeout": 15000000000,
"Retries": 6
},
"Image": "oaisoftwarealliance/oai-upf:v2.0.1",
"Volumes": null,
"WorkingDir": "/openair-upf",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "183a21cd2172a4f68d126d80fc061a2dcc17ffb32aeb2a937bc10c05e61e0715",
"com.docker.compose.container-number": "1",
"com.docker.compose.depends_on": "oai-nrf:service_started:false,oai-smf:service_started:false",
"com.docker.compose.image": "sha256:d2979dd67d1ef5bc70bffbac5668936047c3e4f45556222b54b6f73de743fcc1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "docker-compose",
"com.docker.compose.project.config_files": "/home/hzf/oai/oai-cn5g-fed/docker-compose/docker-compose-basic-nrf.yaml",
"com.docker.compose.project.working_dir": "/home/hzf/oai/oai-cn5g-fed/docker-compose",
"com.docker.compose.service": "oai-upf",
"com.docker.compose.version": "2.21.0",
"support-multi-sgwu-instances": "true",
"support-nrf-fdqn": "true"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "e3654cf9e4ab1aa32f99650629d40b6d6c0e6074da05c9ca2f486fda51792e56",
"SandboxKey": "/var/run/docker/netns/e3654cf9e4ab",
"Ports": {},
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"demo-oai-public-net": {
"IPAMConfig": {
"IPv4Address": "192.168.70.134"
},
"Links": null,
"Aliases": [
"oai-upf",
"oai-upf"
],
"MacAddress": "",
"NetworkID": "0a4f037a255114b7f957b91854533c710b57d107e39ceb89f8d7f1b74e9dc2e9",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DriverOpts": null,
"DNSNames": [
"oai-upf",
"f4ed3f418e12"
]
}
}
}
}
]
3、操作
docker-compose -f docker-compose-basic-nrf.yaml up -d
docker-compose -f docker-compose-basic-nrf.yaml down -t 0
docker-compose -f docker-compose-basic-nrf.yaml up -d oai-upf
docker-compose -f docker-compose-basic-nrf.yaml down oai-upf
docker-compose -f docker-compose-basic-nrf.yaml up oai-upf
docker logs c8fb740c9ec9
docker exec -it 8f91fc1b0678 bash
/openair-upf/bin/oai_upf -c /openair-upf/etc/config.yaml -o
这篇关于oai调试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!