MCPcopy Index your code
hub / github.com/EdgeGallery/mep

github.com/EdgeGallery/mep @v1.6-sprint2-tag

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6-sprint2-tag ↗ · + Follow
1,192 symbols 4,032 edges 158 files 646 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

EdgeGallery MEP项目

License

介绍

Edgegallery MEP是依据ETSI MEC 003 [1]和011 [2]标准实现的MEP开源方案。

ETSI GS MEC 003中定义的MEP,提供了一个使应用程序可以发现、通告、使用和提供MEC服务的环境。在从MEC平台管理器、应用程序或服务接收到流量规则的更新,激活或停用后,MEP会进行对应的执行动作。MEP还从MEC平台管理器接收DNS记录,并使用它们来配置DNS代理/服务器。

通过ETSI GS MEC 011中定义的MEP和应用程序之间的Mp1参考点,可以启用基本功能,例如:

  • MEC服务协同:
    • 提供和使用MEC服务的认证和授权;
    • MEC应用程序向MEC平台注册/注销其提供的MEC服务,并向MEC平台更新有关MEC服务可用性的变化;
    • 向相关的MEC应用程序通知MEC服务可用性的改变;
    • 发现可用的MEC服务;
  • MEC应用协助:
    • MEC应用程序可用性订阅;
    • MEC应用程序终止订阅;

MEP架构

MEP Mp1服务注册和发现基于servicecomb服务中心实现[3]。Servicecomb服务中心是一个基于Restful的服务注册表,提供微服务发现和微服务管理。MEP利用其注册表功能和插件机制来实现Mp1接口。mep-server模块是Mp1 API的MEP服务器的核心实现。提供了API,供MEC Apps在MEC平台中注册或发现服务。

MEP代码目录

├── kong-plugin
│   ├── appid-header
│   └── kong.conf
├── mepauth
├── mepserver
└── README.md

上面是MEP项目的目录树: - kong-plugin: mep api网关kong插件 - mepserver: mep server实现 - mepauth: mepauth模块为应用提供令牌申请api

MEP构建和运行

大多数MEP项目代码是由golang开发的,kong插件是由lua开发的。MEP项目通过docker image发布。

构建mep-auth镜像

cd mepauth
sudo ./docker-build.sh

构建mepserver镜像

cd mepserver
sudo ./docker-build.sh

运行mepauth

docker run -itd --name mepauth \
             --cap-drop All \
             --network mep-net \
             --link kong-service:kong-service \
             -v ${MEP_CERTS_DIR}/jwt_publickey:${MEPAUTH_KEYS_DIR}/jwt_publickey:ro \
             -v ${MEP_CERTS_DIR}/jwt_encrypted_privatekey:${MEPAUTH_KEYS_DIR}/jwt_encrypted_privatekey:ro \
             -v ${MEP_CERTS_DIR}/mepserver_tls.crt:${MEPAUTH_SSL_DIR}/server.crt:ro \
             -v ${MEP_CERTS_DIR}/mepserver_tls.key:${MEPAUTH_SSL_DIR}/server.key:ro \
             -v ${MEP_CERTS_DIR}/ca.crt:${MEPAUTH_SSL_DIR}/ca.crt:ro \
             -v ${MEPAUTH_CONF_PATH}:/usr/mep/mprop/mepauth.properties \
             -e "MEPAUTH_APIGW_HOST=kong-service" \
             -e "MEPAUTH_APIGW_PORT=8444"  \
             -e "MEPAUTH_CERT_DOMAIN_NAME=${DOMAIN_NAME}" \
             -e "MEPSERVER_HOST=mepserver" \
             edgegallery/mepauth:latest

MEP_CERTS_DIR是放置mepauth服务器证书和密钥的位置。MEPAUTH_CONF_PATH是mepauth的配置文件。

运行mepserver

MEP_CERTS_DIR是放置mep服务器证书和密钥的目录。 MEP_ROOT_KEY_COMPONENT是根密钥的随机组件,长度为256。 CERT_PASSPHRASE 是用于创建证书的密码。

docker run -itd --name mepserver --network mep-net -e "SSL_ROOT=${MEPSERVER_SSL_DIR}" \
                                 --cap-drop All \
                                 -v ${MEP_CERTS_DIR}/mepserver_tls.crt:${MEPSERVER_SSL_DIR}/server.cer:ro \
                                 -v ${MEP_CERTS_DIR}/mepserver_encryptedtls.key:${MEPSERVER_SSL_DIR}/server_key.pem:ro \
                                 -v ${MEP_CERTS_DIR}/ca.crt:${MEPSERVER_SSL_DIR}/trust.cer:ro \
                                 -v ${MEP_CERTS_DIR}/mepserver_cert_pwd:${MEPSERVER_SSL_DIR}/cert_pwd:ro \
                                 -e "ROOT_KEY=${MEP_ROOT_KEY_COMPONENT}" \
                                 -e "TLS_KEY=${CERT_PASSPHRASE}" \
                                 edgegallery/mep:latest

有关证书、密钥设置以及MEP构建和安装的更多详细信息,请参阅 HERE.

参考

[1] https://www.etsi.org/deliver/etsi_gs/MEC/001_099/003/02.01.01_60/gs_MEC003v020101p.pdf

[2] https://www.etsi.org/deliver/etsi_gs/MEC/001_099/011/02.01.01_60/gs_MEC011v020101p.pdf

[3] https://github.com/apache/servicecomb-service-center

Extension points exported contracts — how you extend this code

Database (Interface)
Database API's [1 implementers]
mepauth/adapter/db.go
DNSAgent (Interface)
DNSAgent interface [1 implementers]
mepserver/common/extif/dns/dns_if.go
ManagementCtrl (Interface)
ManagementCtrl Management ctrl interface. [1 implementers]
dns-server/mgmt/mgmtif.go
DataStore (Interface)
(no doc) [1 implementers]
dns-server/datastore/storeif.go
APIHookFunc (FuncType)
(no doc)
mepserver/mp1/controller.go
DataPlane (Interface)
DataPlane interface functions [1 implementers]
mepserver/common/extif/dataplane/dataplane_if.go
TaskBaseIf (Interface)
(no doc) [1 implementers]
mepserver/common/arch/workspace/task_base.go
PlanIf (Interface)
(no doc) [1 implementers]
mepserver/common/arch/workspace/workspace_base.go

Core symbols most depended-on inside this repo

Error
called by 432
mepserver/common/arch/bus/base.go
SetFirstErrorCode
called by 198
mepserver/common/arch/workspace/task_base.go
URLPatterns
called by 94
mepserver/mp1/controller.go
Run
called by 65
dns-server/dns.go
ClearByteArray
called by 48
mepauth/util/util.go
URLPatterns
called by 48
mepserver/mm5/controller.go
Try
called by 39
mepserver/common/arch/workspace/workspace_base.go
Finally
called by 39
mepserver/common/arch/workspace/workspace_base.go

Shape

Function 501
Method 467
Struct 203
TypeAlias 12
Interface 8
FuncType 1

Languages

Go100%
TypeScript1%

Modules by API surface

mepserver/mp1/controller_test.go105 symbols
mepserver/mm5/controller_test.go63 symbols
mepserver/common/util/meputil.go49 symbols
mepserver/mp1/controller.go35 symbols
mepserver/mm5/task/sync.go34 symbols
mepserver/common/arch/workspace/workspace_base.go29 symbols
mepauth/adapter/factory_test.go25 symbols
mepauth/util/util.go22 symbols
mepserver/common/arch/workspace/task_base.go19 symbols
mepserver/mm5/controller.go17 symbols
mepserver/common/appd/appd.go17 symbols
mepserver/mp1/plans/dns_one_update.go16 symbols

For agents

$ claude mcp add mep \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page