diff --git a/Makefile b/Makefile index e69de29b..8bcb7430 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,15 @@ +gateway: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-gateway gateway/main.go + +pod: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-pod adaptor/pcm_pod/main.go + +vm: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-vm adaptor/pcm_vm/main.go + +slurm: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-slurm adaptor/pcm_slurm/main.go + +build: gateway pod vm slurm + +.PHONY: gateway pod vm slurm build \ No newline at end of file diff --git a/README.md b/README.md index 69e4e03d..afc71837 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,43 @@ -# PCM +# PCM: Peer Collaboration Mechanism -## protobuf 编译流程 -```shell - sh gen.sh +PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration in a non intrusive and autonomous peer-to-peer manner. It focuses on how to make full use of the computing and storage capabilities of multiple source clouds without changing the heterogeneous cloud computing software stack, rather than implementing a new cloud software stack. From the cloud perspective, PCM superimposes on the cloud and focuses more on collaboration between clouds than on the cloud itself. + +![pcm](docs/imges/pcm.png) + +## Requirements + +--- + +* Linux amd64 + +* [Slurm-2-6-9-1](https://github.com/SchedMD/slurm/archive/refs/tags/slurm-2-6-9-1.tar.gz) + +* [Go](https://go.dev/) 1.19 or higher + +* [GCC](https://gcc.gnu.org/) 4.8.5 or higher + + + +## Quick Start + +--- + +``` +# clone +git clone https://gitlink.org.cn/JCCE/PCM.git + +# get required packages +go mod tidy + +# build pcm components +make build + +# start service +nohup ./pcm-gateway &> pcm-gateway.log & +nohup ./pcm-pod &> pcm-pod.log & +nohup ./pcm-vm &> pcm-vm.log & +nohup ./pcm-slurm &> pcm-slurm.log & ``` -protobuf生成的文件在lan_trans下 \ No newline at end of file +If the startup is successful, the 'gateway' will listen on the '8880' port by default, and no error is reported in the log. The above is a simple demonstration using nohup. It is recommended that the production environment should be hosted by systemd. The relevant service files can be found in the etc/service directory for reference. + diff --git a/docs/etc/service/pcm-gateway.service b/docs/etc/service/pcm-gateway.service new file mode 100644 index 00000000..88e0c119 --- /dev/null +++ b/docs/etc/service/pcm-gateway.service @@ -0,0 +1,19 @@ +[Unit] +Description="pcm-gateway" +Documentation=https://www.gitlink.org.cn/JCCE/PCM +After=network.target + +[Service] +Type=simple + +ExecStart=/usr/local/bin/pcm-gateway + +Restart=on-failure +SuccessExitStatus=0 +LimitNOFILE=65536 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=pcm-gateway + +[Install] +WantedBy=multi-user.target diff --git a/docs/etc/service/pcm-pod.service b/docs/etc/service/pcm-pod.service new file mode 100644 index 00000000..33a20a49 --- /dev/null +++ b/docs/etc/service/pcm-pod.service @@ -0,0 +1,19 @@ +[Unit] +Description="pcm-pod" +Documentation=https://www.gitlink.org.cn/JCCE/PCM +After=network.target + +[Service] +Type=simple + +ExecStart=/usr/local/bin/pcm-pod + +Restart=on-failure +SuccessExitStatus=0 +LimitNOFILE=65536 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=pcm-pod + +[Install] +WantedBy=multi-user.target diff --git a/docs/etc/service/pcm-slurm.service b/docs/etc/service/pcm-slurm.service new file mode 100644 index 00000000..1c12c05a --- /dev/null +++ b/docs/etc/service/pcm-slurm.service @@ -0,0 +1,19 @@ +[Unit] +Description="pcm-slurm" +Documentation=https://www.gitlink.org.cn/JCCE/PCM +After=network.target + +[Service] +Type=simple + +ExecStart=/usr/local/bin/pcm-slurm + +Restart=on-failure +SuccessExitStatus=0 +LimitNOFILE=65536 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=pcm-slurm + +[Install] +WantedBy=multi-user.target diff --git a/docs/etc/service/pcm-vm.service b/docs/etc/service/pcm-vm.service new file mode 100644 index 00000000..03dcfb2e --- /dev/null +++ b/docs/etc/service/pcm-vm.service @@ -0,0 +1,19 @@ +[Unit] +Description="pcm-vm" +Documentation=https://www.gitlink.org.cn/JCCE/PCM +After=network.target + +[Service] +Type=simple + +ExecStart=/usr/local/bin/pcm-vm + +Restart=on-failure +SuccessExitStatus=0 +LimitNOFILE=65536 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=pcm-vm + +[Install] +WantedBy=multi-user.target diff --git a/docs/imges/pcm.png b/docs/imges/pcm.png new file mode 100644 index 00000000..cfa3402d Binary files /dev/null and b/docs/imges/pcm.png differ