惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
J
Java Code Geeks
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog

Nemo

20260819 - Nemo 再见,2025 Complete ORB-SLAM3 Setup Guide for Jetson Xavier NX with RealSense D455 20250723 再见,2024 Using CertBot for Automatic Secure EMQX Broker Create Your Own GPS Data Publisher Support SSL AGV Dispatching System Technical Documentation Finding Nemo No title 香港賽馬會呈獻系列:黑白——攝影敘事 再见,2023 团团是只猫 Design an FSM for Robot State Machines – Basics of Computer Science Data-driven robot lifespan: Collection 数据驱动的机器人寿命:收集、诊断、预测 Exploring the design space of binary search trees 特首来了 Large language models, explained with a minimum of math and jargon 设计有缓存异步逻辑的监控脚本并测试其资源占用 使用loguru记录串口数据并使用Docker搭建ARM开发环境 在vscode的Dev Container中构建.NET开发环境及使用doxygen和graphviz绘制函数调用图 State or Status? A*算法两种时间复杂度 /A* Algorithm: Two Types of Time Complexity 使用KD-Tree快速收敛到最近坐标点/Fast convergence to the nearest coordinate point using KD-Tree 翻译 || 总结 - Go语言中的空结构体(The empty struct) 再见,2022 从PE工作报告中能读出什么 Give me miles, give me truth
Docker实现调度系统整体部署/Docker implementation of dispa...
Nemo · 2022-08-25 · via Nemo

背景

传统的AMR调度系统架构的部署方式和操作面板限制较高。为了打破这种限制,本文提出了使用容器技术实现AMR调度系统迁移性强、成本低廉、多平台化的方案。

涉及到以下内容:

  • Docker镜像自动化部署
  • Django代码加密
  • Dispatching代码加密

Docker

使用centos8.2镜像搭建服务:

  • ssh
  • nginx
  • python
  • mysql
  • redis
  • django
  • mqtt

搭建过程很简单,就不赘述了。规划好各个服务之间的端口区间和统一配置文件,自启动服务,再打包就好了。

自动化部署脚本

利用Docker便于迁移的特性,实现Linux/win的自动化部署

利用Docker便于迁移的特性,实现Linux/win的自动化部署。部署前需要查看宿主机空闲的端口区间是否满足系统部署需要。例如,win下可以使用以下命令查看占用的ipv4的端口区间:

netsh interface ipv4 show excludedportrange protocol=tcp

建议自动化部署脚本具备全离线安装,适应局域网环境。以下是简易版的部署手册:

确认安装清单

共11个文件,其中镜像ubt-amrb-dc.tar的MD5为:f4094908523158f0dd9d66fb4eab56cd,建议复制完成后检查其MD5值是否相同。

微信截图_20220321152009.png

确认客户机环境

为保障性能和稳定性,不推荐在Windows下使用虚拟机搭建业务环境,且需确保环境配置最低为:内存:4G,硬盘空间:60G

确认客户机环境为Centos:

cat /etc/redhat-release

如果显示:CentOS Linux release 7.9.2009 (Core)则符合要求,版本大数为7.9即可。

创建工作目录

如果权限不够,输入:

sudo su

/home下创建rcs目录:

mkdir /home/rcs
拷贝安装文件

确定U盘文件格式为exfat,复制文件到工作目录

mv ./rcs /home/rcs
自动化安装

提升脚本权限:

chmod +x installer.x

运行安装脚本:

./installer.x
导入镜像 ubt-amrb-dc.tar 中...
sha256:97ee8a0f2bf1389ceb2e1703a0328ff86f3400b3d511eacfd2b2b4200e570736
启动容器 with ubt-amrb-dc.tar...
b699b460410477cde69bf730acb5b6f67067f1c1aa2790a1050460b4344acd4e
部署完成!

等待安装完成后,检测docker容器是否运行:

docker ps -a

如果看到ubt-amrb容器运行则安装成功

调试

建议执行诸如重启客户机器和常规冒烟操作测试是否安装成功

tips

  • 进行必要的容器安全设置,不暴露非必要端口、使用秘钥登录、定时清理其他服务、宿主机使用安全策略等

  • 推荐使用systemctl代替/etc/rc.loacl

  • 统一配置文件存放

  • 测试系统周期运行日志文件大小,设定最小需求空间

Django代码加密

常见的有:

  • pyarmor
  • 混淆加密:注意提示语别混淆了,不然显示乱码

按需选择,测试通过就好了

Dispatching代码加密

纯Python程序可以使用pyinstall加密,加密过程见博客:


Background

The traditional architecture of the AMR scheduling system has high deployment and operation panel limitations. To break this limitation, this article proposes a solution that uses container technology to achieve strong migration, low cost, and multi-platform AMR scheduling system.

The following contents are involved:

  • Docker image automation deployment
  • Django code encryption
  • Dispatching code encryption

Docker

Use the centos8.2 image to build the following services:

  • ssh
  • nginx
  • python
  • mysql
  • redis
  • django
  • mqtt

The installation process is very simple and will not be repeated here. Plan the port range between each service and the unified configuration file, start the service automatically, and then package it.

Automation Deployment Script

Use the feature that Docker is easy to migrate to achieve automated deployment on Linux/win.

Before deployment, you need to check whether the available port range of the host meets the system deployment needs. For example, you can use the following command to view the IPv4 port range occupied by win:

netsh interface ipv4 show excludedportrange protocol=tcp

It is recommended that the automated deployment script have full offline installation capabilities to adapt to the local area network environment. Following is the simplified deployment manual:

Confirm Installation List

There are a total of 11 files, among which the MD5 of the image ubt-amrb-dc.tar is: f4094908523158f0dd9d66fb4eab56cd, it is recommended to check whether their MD5 values are the same after copying is completed.

https://kanghaov-img-1256185664.file.myqcloud.com/2022/03/21/bbd7762e298b2.png

Confirm Client Environment

To ensure performance and stability, it is not recommended to use virtual machines to build business environments under Windows, and it is necessary to ensure that the environment configuration is at least: memory: 4G, disk space: 60G.

Confirm that the client environment is CentOS:

cat /etc/redhat-release

If it displays: CentOS Linux release 7.9.2009 (Core), it meets the requirements, and the version number is greater than or equal to 7.9.

Create Working Directory

If the permission is not enough, enter:

sudo su

Create the rcs directory under /home:

mkdir /home/rcs

Copy Installation Files

Make sure the USB file format is exfat and copy the files to the working directory.

mv ./rcs /home/rcs

Automated Installation

Elevate the script permissions:

chmod +x installer.x

Run the installation script:

./installer.x
Importing image ubt-amrb-dc.tar...
sha256:97ee8a0f2bf1389ceb2e1703a0328ff86f3400b3d511eacfd2b2b4200e570736
Starting container with ubt-amrb-dc.tar...
b699b460410477cde69bf730acb5b6f67067f1c1aa2790a1050460b4344acd4e
Deployment completed!

After waiting for the installation to complete, check whether the docker container is running:

docker ps -a

If you see the ubt-amrb container running, the installation is successful.

Debugging

It is recommended to perform necessary container security settings, do not expose unnecessary ports, use key login, regularly clean up other services, and use security policies on the host.

  • Recommend using systemctl instead of /etc/rc.local
  • Unified configuration file storage
  • Test the size of the running log file of the system and set the minimum space requirement

Django Code Encryption

Common ones are:

  • pyarmor
  • Obfuscation encryption: pay attention to not obfuscate the prompt language, otherwise it will display garbled characters.

Choose as needed, and pass the test.

Dispatching Code Encryption

Pure Python programs can use PyInstall encryption, and the encryption process is shown in the blog: