(User-PC Computing System)
A full-stack computational system using Docker, buildpack to simplify the processing of all kind of tasks.
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-docker.sh -o start-docker.sh &&
chmod +x start-docker.sh &&
./start-docker.sh
- Process jobs: Process different kinds of jobs in various backend hosts in the system.
- File management: Upload/Delete files in the backend-server.
- Docker Image Generation: Generate Docker images through uploaded zip file using Buildpack.
- Terminal integration: Expose backend host terminal to frontend to let users to execute commands.
- Server registration: Register and manage backend API servers/frontend React servers by Register-Server(loacl or cloud).
- Database Integration: Store and manage data in MongoDB(cloud).
- Deploy by Docker using shell script: Deploy the whole system by running a command.
The UPC system consisted three main components:
- UPC-Worker (backend server)
- User Interface (React frontend)
- Register Server (A cloud or local central server to manage the system)
Frp is a fast reverse proxy that allows you to expose a server(service) from a local network.
Frp forwards requests to internal services via a server with a Public IP.
The order to generate a Docker image in UPC system:
- Whole UPC system:
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-docker.sh -o start-docker.sh &&
chmod +x start-docker.sh &&
./start-docker.sh
- (Backend only) API-service:
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-api-docker.sh -o start-api-docker.sh &&
chmod +x start-api-docker.sh &&
./start-api-docker.sh
- for x86 arch host:
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-x86-api-docker.sh -o start-x86-api-docker.sh &&
chmod +x start-x86-api-docker.sh &&
./start-x86-api-docker.sh
- (Frontend only) Frontend-service:
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-react-docker.sh -o start-react-docker.sh &&
chmod +x start-react-docker.sh &&
./start-react-docker.sh
- Register-service:
curl -sSL https://raw.githubusercontent.com/comevback/UPC-node/main/start-register-docker.sh -o start-register-docker.sh &&
chmod +x start-register-docker.sh &&
./start-register-docker.sh
- Whole UPC system:
docker run -it --rm -e HOST_URL={http://your_API_host:4000} -e CENTRAL_SERVER={http://your_central_server:8000} -e INITIAL_API_URL={http://your_API_host:4000} -e INITIAL_CENTRAL_SERVER_URL={http://your_central_server:8000} -v /var/run/docker.sock:/var/run/docker.sock -p 3000:3000 -p 4000:4000 -p 8000:8000 afterlifexx/upc-system
for example:
docker run -it --rm -e HOST_URL=http://192.168.0.103:4000 -e CENTRAL_SERVER=http://192.168.0.103:8000 -e INITIAL_API_URL=http://192.168.0.103:4000 -e INITIAL_CENTRAL_SERVER_URL=http://192.168.0.103:8000 -v /var/run/docker.sock:/var/run/docker.sock -p 3000:3000 -p 4000:4000 -p 8000:8000 afterlifexx/upc-system
docker run -it --rm -e HOST_URL=http://172.28.235.225:4000 -e CENTRAL_SERVER=http://172.28.235.225:8000 -e INITIAL_API_URL=http://172.28.235.225:4000 -e INITIAL_CENTRAL_SERVER_URL=http://172.28.235.225:8000 -v /var/run/docker.sock:/var/run/docker.sock -p 3000:3000 -p 4000:4000 -p 8000:8000 afterlifexx/upc-system
- (Backend only) API-service:
docker run -it --rm -e HOST_URL={http://your_API_host:4000} -e CENTRAL_SERVER={http://your_central_server:8000} -v /var/run/docker.sock:/var/run/docker.sock -p 4000:4000 afterlifexx/upc-api
- for example( API service ):
docker run -it --rm -e HOST_URL=http://172.28.235.64:4000 -e CENTRAL_SERVER=http://172.28.235.225:8000 -v /var/run/docker.sock:/var/run/docker.sock -p 4000:4000 afterlifexx/upc-api
- (Frontend only) Frontend-service:
docker run -e REACT_APP_INITIAL_API_URL={http://your_API_host:4000} -e REACT_APP_INITIAL_CENTRAL_SERVER_URL={http://your_central_server:8000} -p 3000:3000 afterlifexx/upc-react
- Register-service:
docker run -it --rm -p 8000:8000 afterlifexx/upc-register
These instructions will get you a copy of the project up and running on your local machine for development.
- Node.js: https://nodejs.org/en/download
- Docker: https://www.docker.com
- buildpack: https://buildpacks.io/docs/tools/pack
- MongoDB(optional): https://www.mongodb.com
- Clone the repository:
git clone https://github.com/comevback/UPC-node.git
cd UPC-node
- Install dependencies for the all:
- Linux/MacOS:
npm run install-all
or
chmod +x install.sh
./install.sh
- Windows: (If you are using Windows, please use git bash or other kinds of bash)
chmod +x install.sh
./install.sh
- Run the setup scripts to change the ip address of backend server to your host ip address
chmod +x setArgs.sh
./setArgs.sh
If you want to use Database to store the registered service, create a .env file on register-server folder, and add a line as:
MongoURL={your-mongoDB-RUL}
otherwise the data will be loacl.
Run Frontend-Server Backend-Server and Register-Server at the same time:
npm start
Or run individual part:
- Register-Server:
cd register-server
npm start
- Backend-Server:
cd backend/UPC-nodejs
npm start
- Frontend-Server:
cd frontend/upc-react
npm start
- Start the React(frontend) API(backend) servers and Register-Server.
- Compress the directory of the task in to .zip file,
- Upload the compressed file on React website,
- Generate a image for this kind of task,
- Upload files and process,
- Download the results.
Xu Xiang
This project is licensed under the MIT License - see the LICENSE file for details.