After generating the data from the simulation, follow these steps to download it from the GRID platform:

  1. Navigate to the GRID platform’s Storage tab, which is located next to the Terminal tab.
  2. Press the Download button to directly save the data to your local machine.

By following these steps, you can efficiently capture and store sensor and image data from your simulations onto your local system.

For extremely large files, there might not be a notification pop-up about the download in your browser. In such cases, check the download folder on your local machine to verify if the download has started.
We are actively working on fixing this issue.

This section provides an overview of the advanced settings available within GRID Enterprise. These settings provide further customization and control over your development setup.

Docker Commands

While GRID Enterprise’s CLI seamlessly handles Docker authentication and basic orchestration, advanced users may seek greater control and customization by interacting directly with Docker. The following Docker commands provide a deeper level of control over containers and their configurations.

1. Monitor Container Logs

Monitoring container logs is crucial for debugging and ensuring that your applications are running smoothly.

Command:

docker logs -f <container_name>

Description:

  • -f: Follows the log output in real-time, allowing you to monitor logs as they are generated.

Example:

docker logs -f <container_name>

2. Access Container Shell

Accessing the container’s shell allows for in-depth troubleshooting and direct interaction with the container’s environment.

Command:

docker exec -it <container_name> /bin/bash

Description:

  • -i: Interactive mode.
  • -t: Allocates a pseudo-TTY.
  • /bin/bash: Specifies the shell to use inside the container.

Example:

docker exec -it <container_name> /bin/bash

3. Inspect Container Details

Inspecting a container provides detailed information about its configuration, state, and resource usage, aiding in troubleshooting and optimization.

Command:

docker inspect <container_name>

Description:

  • Retrieves comprehensive details about the specified container in JSON format.

Example:

docker inspect <container_name>

4. Monitor Container Resource Usage

Keeping track of a container’s resource consumption ensures that it operates efficiently without overusing system resources.

Command:

docker stats <container_name>

Description:

  • Provides real-time statistics on CPU, memory, network, and disk usage for the specified container.

Example:

docker stats <container_name>

5. Update Docker Containers

Updating containers ensures that you have the latest features, security patches, and performance improvements. This process involves pulling the latest image, stopping and removing the existing container, and deploying a new one with the updated image.

Steps to Update a Container:

  • Pull the Latest Image:
docker pull sfgrid.azurecr.io/grid/core/<container_name>:latest

Example:

docker pull sfgrid.azurecr.io/grid/core/<container_name>:latest
  • Stop the Running Container:
docker stop <container_name>

Example:

docker stop <container_name>
  • Remove the Existing Container:
docker rm <container_name>

Example:

docker rm <container_name>
  • Run the Updated Container:
docker run -d --name <container_name> sfgrid.azurecr.io/grid/core/main:latest

Example:

docker run -d --name <container_name> sfgrid.azurecr.io/grid/core/main:latest

Data Storage

Images generated during sessions are saved inside the Docker container in the /app/images directory. To save an image using Python, use the following code snippet:

import os
from PIL import Image

# Define the directory inside the container where images are saved
IMAGE_SAVE_DIR = "/app/images"

# Ensure the directory exists
os.makedirs(IMAGE_SAVE_DIR, exist_ok=True)

# Save the image
image.save(os.path.join(IMAGE_SAVE_DIR, "generated_image.png"))

To transfer the saved images from the Docker container to a location on your host machine, use the docker cp command as shown below:

docker cp <container_name>:/app/images /path/on/host

Example:

If your container is named grid_core and you want to copy images to /home/user/images, run:

docker cp grid_core:/app/images /home/user/images

This command copies all images from the container’s /app/images directory to your specified host directory, allowing you to access and manage them outside the Docker environment.