You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: system/tpcm.md
+84-35
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ This document describes the high level design details of Third Party Container M
67
67
68
68
# Requirements Overview
69
69
70
-
This document describes mechanisms for Third Party Container Management(TPCM) in the SONiC environment. The TPCM allows the user to Install and Manage the custom container into the SONiC.
70
+
This document describes mechanisms for Third Party Container Management(TPCM) in the SONiC environment. The TPCM allows the user to Install and Manage the TPC docker into the SONiC.
71
71
72
72
SONiC is a network operating system based on the Debian distribution. The SONiC components are tightly integrated with the installation image that are created during the build time itself. It allows the user to install the additional tools from the standard Debian repo, but any addition of new components to the SONiC system requires the rebuilding of the SONiC binary image. This feature allows user to install the third party components in the form of containers and that can be loaded and integrated as part of the SONiC system independently without rebuilding of SONiC image.
73
73
@@ -174,6 +174,7 @@ By default, for each TPC docker, the CPU resource limit is restricted to 20%. Me
174
174
- SFTP SERVER - Copied from a remote server through sftp protcol.
175
175
- MEDIA PATH - Copied from a local media folder.
176
176
- DOCKER HUB - Downloaded from remote Docker registry.
177
+
- LOCAL IMAGE - Use one of the existing docker image.
177
178
178
179
- One or more TPC images can be installed on the SONiC system. Once the SONiC OS is up, the TPC instance can be brought up into SONiC by running tpcm install command.
179
180
@@ -197,7 +198,7 @@ By default, for each TPC docker, the CPU resource limit is restricted to 20%. Me
197
198
198
199
- Example:
199
200
200
-
tpcm uninstall \<tpc-name\> -y
201
+
tpcm uninstall <tpc-name> -y
201
202
202
203
- During the uninstallation process, the following steps get executed.
203
204
@@ -222,92 +223,137 @@ By default, for each TPC docker, the CPU resource limit is restricted to 20%. Me
222
223
223
224
## TPC Docker Upgrade
224
225
225
-
- The TPCM framework allows the user to upgrade the running TPC Dockers. The tcpm framework upgrade option allows the user to upgrade an existing TPC docker with a new one. During the upgrade process, TPCM provides the interface to run the pre/post script of a container if it is present inside the TPC container. These hook allows the user to take the backup of data from existing container and restore it back to the upgraded Docker. The pre hook is executed as part of running container and the post hook is executed as part of the upgraded container. The hook scripts should be placed in a fixed folder in the TPC container with the name as /tpc/hook/pre.sh' and 'tpc/hook/post.sh'. The pre script should create a backup file with the name as '/tpc/backup/data.tar.gz' and the post script should restore the contents from the data file. For each TPC, the volume '/tpc/' is mounted from host partition '/host/tpc/\<tpc-name\>'.
226
+
- The TPCM framework allows the user to upgrade the running TPC Dockers. The tcpm framework upgrade option allows the user to upgrade an existing TPC docker with a new one. During the upgrade process, TPCM provides the interface to run the pre/post script present in the container. These hook allow the user to take the backup of data from existing TPC container and restore it back into the upgraded TPC Docker. Each TPC is provided with private data volume for storing the container data which will presist across docker upgrade. The pre/post hook is an optional script that should be added by the user and it will be based on the user needs on what data to be backed up during the upgrade. If all the TPC's data is already stored on the private volume or user doesnt want to take data backup during upgrade then this script is optional.
227
+
228
+
- The pre hook is executed as part of running container and the post hook is executed as part of the upgraded container.
229
+
- These scripts are optional and it get executed only if it is present in the container. It skips the script execution if it is not present.
230
+
- Two level of hook script is supported.
231
+
1. Internal hook scripts
232
+
- These scripts are prepared by the user and it should come along with the container.
233
+
- The internal hook scripts should be placed in a fixed folder in the TPC container with the name as /tpc/scripts/pre.sh' and '/tpc/scripts/post.sh'.
234
+
- These scriptes get executed only if it is present inside the container.
235
+
236
+
2. External hook scripts
237
+
- These scripts are prepared by the user and stored in the host folder and volume mount into TPC.
238
+
- It will presist across TPC upgrade.
239
+
- It should be placed in a fixed folder in the Host with the name as /tpcm/tpc/<tpc-name>/pdata/scripts/pre.sh' and '/tpcm/tpc/<tpc-name>/pdata/scripts/post.sh'.
240
+
- As part of volume mount, it automatically get mapped into the TPC with the name as /tpc/pdata/scripts/pre.sh' and '/tpc/pdata/scripts/post.sh'.
241
+
- The pre script should create a backup data file and store them into '/tpc/pdata/' folder inside the container, and the post script should restore the contents from the data file.
242
+
- For each TPC, a private volume '/tpc/pdata' is mounted from host partition '/tpcm/tpc/\<tpc-name\>' for saving the data across TPC upgrade.
\<tpc-container-name\> => Name of the TPC container to be loaded.
299
-
\<Image name\> => Name of the image to be downloaded.
320
+
<tpc-container-name> => Name of the TPC container to be loaded.
321
+
<Image name> => Name of the image to be downloaded.
300
322
[Tagname] => Optional, Tagname of the image, by default 'latest' would be taken.
301
-
--args => It specifies the additional container creation parameters.
302
323
[-y] => User confirmation
324
+
--args => It specifies the additional container parameters.
325
+
- Example:
326
+
327
+
tpcm install name mydocker pull ubuntu:latest -y
328
+
329
+
#### Use one of the existing docker image
330
+
It uses one of the exising docker images installed in the system. It simply creates the service file and takes care of TPC and migration feature across the image upgrade. This allows the user to use the regular docker commands to create the TPC images. Once the image is ready, user can associate TPCM management feature to it.
0 commit comments