Included Tools:
- nvidia-smi: Lets you check the GPU model in the instance.
- neofetch: Lets you check the hardware you’re running on. Note, neofetch will not display the GPU available in your instance, you’ll need to use nvidia-smi for this.
- curl & wget: Lets you curl websites and download files.
- nano: Lets you edit any files on the instance.
- ping: So you can check external networking is working on the instance.
- btop: Lets you check running processes and stats of the instance.
Included scripts/examples
- Example IPv6 enabled server API: This is an example server that is configured to use IPv6 for compatibility with
SaladCloud. It offers three endpoints.
- Running a GET to
https://{saladURL}/
will return a randomly generated string unique to the machine.- EG:
curl -H "Content-type: application/json" 'https://{saladURL}/'
- EG:
- Running a POST to
https://{saladURL}/hello
with the following body:{"message": "Hello"}
will return either Goodbye or Hello depending on whether the content of the message field is ‘Hello’ or ‘Goodbye’. *note, only Hello and Goodbye are supported messages.*- EG:
curl -XPOST -H "Content-type: application/json" -d '{"message": "Hello"}' 'https://{saladURL}/hello'
- EG:
- Running a POST to https:///set with the following schema:
{"set": "example_text"}
will change the randomly generated string on thehttps://{saladURL}/
route to a custom string of your choosing.- EG:
curl -XPOST -H "Content-type: application/json" -d '{"set": "example_text"}' 'https://{saladURL}/set'
- EG:
- Running a GET to
- Example Environment Variable definitions: Running ./env_test.sh will echo the example defined Environment Variables defined for your container group. We’ve pre-defined some in this example image by default.
- Example JWT retrieval from our Instance Metadata
Service (IMDS): Running
python3 jwt.py
will return the current JWT inside the container. Please note, the IMDS only runs when deployed on Salad, you cannot access it when running this image locally. - Readiness probe test: Running ./readiness-probe.sh will disable the ready status of this container instance for 2 minutes, before returning to ready. You can check it on the deployment page for this group.
- Liveness probe: This deployment also contains a Liveness probe, it’s checking to see if the ‘liveness’ file
exists, and as long as it remains reachable the container will stay alive. If the file disappears or becomes
unavailable, the container will exit and automatically reallocate. Try deleting it with
rm liveness
. - Speedtest: This container also contains an internet speedtest. Run it with
./speedtest.sh
. Please note, results may not be 100% accurate to download speeds with other services. The speedtest downloads a 1.3GB file from testfile.org.
Using the image
Start by entering the /app directory from the terminal withcd /app
.
The image comes with a readme.sh file which will also contain all the above information.
We configured the image to sleep for a long period of time (approximately 16 years) at startup, this is required in
order to keep the instance running on the node. Manually closing this process will cause the instance to shut down and
reallocate.
We recommend you to use this image to test SaladCloud is working and you have the right settings configured, or to try a
single-use setup to verify your app or program works, without needing to build your final image first.
SaladCloud Replicas are best used stateless, interacting with a specific replica or deployment via the terminal in
stateful manners is not recommended, as replicas can be reallocated at any time due to the spot-instance style of
deployment. Once reallocated, you’ll be wiped clean with a base Ubuntu image again. The same will happen if you have
multiple deployed replicas, only one replica will receive the changes you make and could be wiped clean without warning.