Workspaces

Workloads

With Demeter, you can start building your dApp end-to-end; Demeter provides the full suite of tools to do that but, most importantly, a ready-to-code dev environment to use as a Playground. These environments are designed to maximize developer productivity with a no-setup VSCode development environment that runs on your browser, doing the infrastructure heavy lifting for you and with no need to set up Cabal, Nix, GHC manually.

Start a new Workload

The workloads run in the context of a Demeter (opens in a new tab) Project. A Project can host as many workloads as you need. There is no limit to the number of workloads you can create, and there is no limit to the number of workloads you can run simultaneously.

You can start a new workloads just with a few clicks. First, go to your Projects home page by selecting the Projects button. From the list of Projects, press the open button on the Project you want to create a workloads.


Then select the Create New button.


Here, you can select:

  • Workspace: a no-setup VSCode environment in your browser,
  • Frontend: a docker container running a frontend with access to the exposed Demeter services,
  • Backend: a docker container running a backend with access to the Demeter services, and
  • Backend with storage: a docker container with an attached volume running a backend with access to the Demeter services.

Workspaces

You can create your first Workspace for accessing a cloud-based development environment ready to code, with the option to clone an existing git repository if you have one and the coding stack of your preference. Demeter allows you to set the workspace size depending on your Project needs, select the network to connect, a Git Author, and a Git Email.



Once you have customized your development environment, select the Create button to start provisioning your workspace.


When it's ready, select the Open VS Code button to open the Dev console. You can also view Logs in real-time, update the details of your workspace and start it or pause it when you are done using it. On the same screen, you can expose ports, connect extensions to your project and see a list of available environmental variables inside your workspace that can be used to access your connected extensions.



There is no limit to the number of Workspaces you can create or run in parallel under a Project. But keep in mind that each Workspace you have created will consume Resources for your Project. Always keep only the Workspaces you need to optimize your resources consumption. By selecting the Dashboard button at the top, you can see the details of your DCUs usage at the end of the page.


⚠️

Running a Workspace consumes a considerable amount of resources. Always remember to Pause your Workspace when you are done using it. To learn more about managing resources consumption, read our guide about DCUs.

Coding Stack

Select the set of tools and libraries to have pre-installed automatically in your Workspace:

NameStack
plutusVSCode + Haskell + GHC + Cabal + Nix. The latest Cardano derivations from IOHK Nix cache.
haskellVSCode + Haskell + GHC. Good for starting from scratch with the Haskell language.
typescriptVSCode + NodeJS + Typescript. Good for creating frontends using Berry-Pool's Lucid framework.
rustVSCode + Rust + Cargo. Good for creating projects using Pallas building blocks
golangVSCode + Golang. Good for creating projects using CloudStruct Ouroboros library.
pythonVSCode + Python 3.8. Good for creating projects using the PyCardano framework.
javaVSCode + OpenJDK 17 + Gradle + Maven. Good for creating projects using the Java language.

Workspace Size

NameDescription
smallcpu: 1 - mem: 4 Gb - disk: 10 Gb
mediumcpu: 2 - mem: 8 Gb - disk: 50 Gb
largecpu: 4 - mem: 16 Gb - disk: 100 Gb

Git Author

Sets the git global configuration user.name

Git email

Sets the git global configuration user.email

Once you have selected your Workspace settings, press the CREATE WORKSPACE button to get it started. Your Workspace will start provisioning automatically.


When provisioning is completed and all dependencies installed, you can press the OPEN VSCODE button to open a ready-to-code environment.


vs code

Repository

If no repository is selected, we will generate an empty coding environment with the chosen tech stack, but if you have a Project with a dependency on Cardano infrastructure it's easy to integrate it with Demeter (opens in a new tab) to have it up and running in a Workspace in no time. Just include our CTA button in your Project for starting a Workspace with your repository code automatically cloned, providing a seamless experience for your users when running and trying your application.

Code in Workspace

Adding the button badge to your Readme
![Code in Workspace](https://demeter.run/code/badge.svg)
Setting the button link
(https://demeter.run/code?repository={YOUR REPOSITORY URL}&template={YOUR TECH STACK NAME}&size={YOUR WORKSPACES SIZE})

Available tech stacks

NameStack
plutusVSCode + Haskell + GHC + Cabal + Nix. The latest Cardano derivations from IOHK Nix cache.
haskellVSCode + Haskell + GHC. Good for starting from scratch with the Haskell language.
typescriptVSCode + NodeJS + Typescript. Good for creating frontends using Berry-Pool's Lucid framework.
rustVSCode + Rust + Cargo. Good for creating projects using Pallas building blocks
golangVSCode + Golang. Good for creating projects using CloudStruct Ouroboros library.
pythonVSCode + Python 3.8. Good for creating projects using the PyCardano framework.

Available workspaces sizes

NameDescription
smallcpu: 1 - mem: 4 Gb - disk: 10 Gb
mediumcpu: 2 - mem: 8 Gb - disk: 50 Gb
largecpu: 4 - mem: 16 Gb - disk: 100 Gb
Example URL
(https://demeter.run/code?repository=https://github.com/txpipe/python-dbsync-starter-kit.git&template=python&size=small)

Delete a Workspace

To delete a workspace you need to select it from the list by clicking on the button on the right.


Inside the Workspace detail, you have the option to Delete your Workspace.


⚠️

Deleting a Workspace will remove all of its associated information. This operation can not be undone.

Explore more about what you can do with Workspaces in our Extensions section.

Access resources from your Workspace

From inside your Workspace, you can access all the resources available in Demeter (opens in a new tab), i.e.: Cardano Node, DB-Sync, Ogmios, Kupo, Webhooks, etc. All pre-configured environment variables will be available according to the enabled extensions.

Working and making changes

Can I push my changes back to the git repository?

Yes, but you'll need to specify your git authentication credentials manually. By default, your workspace has the git remote origin pointing to the repository specified during creation. By running "git push origin", the git client will ask you for the corresponding credentials. The credentials to be used depend on the particular provider.

Do I lose my files when a Workspace restarts?

Most of your system personalizations. Anything outside the $HOME directory will NOT be persisted and effectively lost after your Workspace is paused.

DCUs and Resources Consumption

Demeter Compute Units (DCUs) are an abstraction layer implemented in Demeter (opens in a new tab) to measure infrastructure usage. Having a workspace running consumes several resources. To optimize resource consumption, make sure you always pause your workspace after completing your work.

For pausing a Workspace, you can select the pause button from the Workspace detail screen.


workspaces list

For the Workspaces paused, there is still a minimal amount of resources consumed per unit of time, given that all of your configuration and changes are persisted in the cloud. If you don't need a Workspace anymore, make sure you delete it from the list. For deleting a Workspace you can go to the bottom of the screen and press the Delete button.


workspaces detail

What happens if I leave my Workspace running?

Workspaces that are inactive after 30 minutes will be paused automatically. Regardless of the automatic pause, we recommend manually pausing your workspace right after you finish working to avoid wasting valuable resources.

Docker Containers

Get to the market fast by hosting the off-chain components of your dApp with Demeter. Here, we provide detailed instructions on how to package your application so that it's hosted side-by-side with the rest of the required Cardano infrastructure.

You can select between a Frontend, a Backend, or a Backend with storage.


In all cases, when creating a new Container, you'll need to enter the container info. First, enter a name to identify your Container, the docker image to use (it has to be publicly available), the arguments to be passed to the docker's image entry point, and the environment variables needed for your image to run.


Then, select the number of replicas and the container size.


Finally, choose a network to connect to and select the Create button.


In case you choose a Backend with storage, you'll need to select also the storage size and storage class.


Now you're ready to deploy your dApp; we'll keep it running for you.