Abilities to manage deployed Akash containers have been accentuated greatly within this release. Introduced deployment capabilities include:
- Ability to execute commands within running Linux containers/Akash deployments. Such an ability resembles “docker exec” command execution within a live container instance.
- Ability to gain access to the CLI/shell of a running Linux container/Akash deployment.
- Ability to remote copy files from running Linux containers/Akash deployments to a local file instance for inspection.
In the subsections which follow granular details of these introduced features will be explored with example executions and depictions.
Remote Shell Command Execution
Execute command sets within a running Akash deployment
- Command template with variable bracketing as such <variable-name>
- Notes of interest pertaining to command execution:
- The service-name variable must match the service value in the deployment’s SDL. For example - in the depicted segment of an SDL file below - the service-name in remote shell execution would be “web”
-
Example command fully populated
-
Example command fully populated using environment variables
-
Prior establishment of the AKASH_KEY_NAME and AKASH_PROVIDER environment variables would be necessary to allow this syntax
- Expected output example
Access the Deployment Shell (CLI)
Gain access to an active Akash deployment’s CLI/shell
- Command template with variable bracketing as such <variable-name>
- Command notes of interest:
- The service-name variable must match the service value in the deployment’s SDL. For example - in the depicted segment of an SDL file below - the service-name in remote shell execution would be “web”
- Note the “tty” switch dictating desire for shell/CLI access
- Example command fully populated
- Note - the container instance must have a /bin/sh shell for the command to work in this exact syntax. If this were an Alpine container base image /bin/sh would need to become /bin/ash and this serves as an example of possible edit to the command syntax based on container type.
- Prior establishment of the AKASH_KEY_NAME and AKASH_PROVIDER environment variables would be necessary to allow this syntax
- Expected output example
- Note - Linux commands “pwd” and “ls” are included and as executed within the deployment to validate Akash container shell access
Copy File from Akash Container/Deployment
Copy a file from an active Akash deployment to a local file instance for inspection
- Command template with variable bracketing as such <variable-name>
- Command notes of interest:
- The service-name variable must match the service value in the deployment’s SDL. For example - in the depicted segment of an SDL file below - the service-name in remote shell execution would be “web”
- Example command fully populated
- Example command fully populated using environment variables
- Prior establishment of the AKASH_KEY_NAME and AKASH_PROVIDER environment variables would be necessary to allow this syntax
- Expected output example
- Note - Linux command “ls” and “cat” are included in the depiction to validate successful file copy from remote Akash container/deployment to local file
SDL Example Utilized
Full SDL code samples used throughout this guide