Develop an application Golem
Developing an application on golem consists of two major steps:
- Writing one or more Golem components in one of the supported programming languages.
- Defining external HTTP endpoints
This page summarizes the workflow of developing an application on Golem, with links to more specific guides for each step.
Creating an application
The primary tool for developing an application on Golem is the Golem CLI.
To create a new application, use the golem app new
command, passing the name of the application and it's default programming language (note: it is possible to add components using different languages later).
golem app new my-app rust
Writing the code
The application is just a project directory that can contain multiple components. To learn how to add a new component and implement it, check the language specific guides linked below.
Guidelines per language
Experimentally supported languages
Iterations
During development the whole application can be built using
golem app build
and every component can be deployed using
golem app deploy
This is going to create a new version of each component. If there are workers created already, those are not going to be updated automatically to these new versions. Check the workers page for more information about updating workers.
Defining APIs
Most applications require a public HTTP API (but this is not mandatory - you can always use Golem's invocation API to directly communicate with your Golem application).
Guidelines
Check the defining custom APIs page as a starting point for learning how to define custom APIs.
The recommended way to manage these custom APIs is to create a single API definition YAML in the application's root directory. Future Golem versions will integrate API definitions into the application manifest itself.
Iterations
Use the golem api
commands to iterate on your APIs.
Incrementing the version
Every time you make changes, the API's version must be incremented in the YAML file.
Uploading
Upload the new API definition using the golem api upload
command:
golem api definition update api.yaml
(Use golem api definition new api.yaml
the first time)
Deleting the previous deployment
Before deploying the new API version, the previous deployment must be deleted using the golem api deployment delete
command:
golem api deployment delete my-definition/0.0.1
Deploying
To try out the actual API, you also have to deploy it using the golem api deploy
command:
golem api deployment deploy my-definition/0.0.2
Breaking the component APIs
When an API is using a component's exported interface, it is not possible to deploy a new version of that component if it is breaking that used interface (golem app deploy
will fail). To resolve this, delete the deployment first as shown above.