G
G
Golem SDK
Search…
Self-hosted VM images
Publishing VM images outside Golem's repository
To streamline the experience for Golem developers, we provide a central repository for the VM images (.gvmi files) which has been described in the previous article.
At the same time, we realize that application developers may choose to publish said images in other, publicly-accessible locations at their discretion.
The process of preparation and conversion of a self-published GVMI image is mostly the same as for the images uploaded into Golem's central repo. However, once you have the .gvmi file ready, there are two additional steps that need to be performed.

Obtaining the VM image hash

When you upload and image to Golem's repo, the image hash is calculated and conveniently provided to you after a successful upload.
When you decide not to push the image that way, you need to calculate the SHA3 hash on your own. Golem's VM images use 224-bit SHA3 hashes and the easiest way to obtain such a hash is to run the sha3sum tool on the .gvmi file.

Install sha3sum

Ubuntu
Mac
1
apt install sha3sum
Copied!
1
brew install sha3sum
Copied!

Calculate the image hash

1
sha3sum -a 224 <image_filename.gvmi>
Copied!
The calculated hash is then printed alongside the filename and you need to note down this hash since it needs to be provided to the API so that later, the providers can verify the integrity of the VM images they download before they're able to deploy them.

Using the URL and the hash

Once the VM image file is uploaded to a location of your choosing and you have the file's hash, you only need to provide this data to the API when the Package for your app is constructed.
In order to do that, use the following vm.repo() call:
1
package = await vm.repo(
2
# we still need to provide the image's hash because
3
# the image's integrity is validated by the runtime on the provider node
4
#
5
# the hash can be calculated by running `sha3sum -a 224 <image_filename.gvmi>`
6
#
7
image_hash="d646d7b93083d817846c2ae5c62c72ca0507782385a2e29291a3d376",
8
9
# the URL can point to any publicly-available location on the web
10
image_url="http://girepo.dev.golem.network:8000/docker-golem-hello-world-latest-779758b432.gvmi",
11
)
Copied!
For full usage, please refer to the relevant part of the API reference:
Golem Python API Reference — yapapi 0.7.0 documentation
vm.repo() usage
Last modified 1mo ago