Gitpod. The better way to run Mojo remotely

Here I will describe my work to configure Gitpod for mojo in the simplest way.
No description
13 Replies
Sarctiann
SarctiannOP14mo ago
After Fork the mojo repo. and before (instead of) creating a GitHub workspace: - In the root of the repo, create a file called .gitpod.yml with this content:
# List the start-up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
tasks:
- name: Install Modular & Mojo
before: |
eval $(command gp env -e)
command: |
curl https://get.modular.com | MODULAR_AUTH=$MODULAR_AUTH sh -
modular install mojo
echo 'export MODULAR_HOME="/home/gitpod/.modular"' >> ~/.zshrc
echo 'export PATH="/home/gitpod/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

vscode:
extensions:
- "modular-mojotools.vscode-mojo"
- "ms-python.python"


# List the start-up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
tasks:
- name: Install Modular & Mojo
before: |
eval $(command gp env -e)
command: |
curl https://get.modular.com | MODULAR_AUTH=$MODULAR_AUTH sh -
modular install mojo
echo 'export MODULAR_HOME="/home/gitpod/.modular"' >> ~/.zshrc
echo 'export PATH="/home/gitpod/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

vscode:
extensions:
- "modular-mojotools.vscode-mojo"
- "ms-python.python"


Also, create the folder and file .vscode/setting.json with this content:
{
"mojo.modularHomePath": "/home/gitpod/.modular"
}

{
"mojo.modularHomePath": "/home/gitpod/.modular"
}

and commit your changes. 1. Go to Gitpod and log in with your GitHub account. 1. Go to Projects 1. Create a Project by selecting your forked repo. 1. Click on Enable Prebuilds 1. Mark the checkbox Enable Prebuilds 1. You are in the General tab in the sidebar. Go to Variables 1. Create an env variable called MODULAR_AUTH with your auth token as value. (You can get it from the SDK installation page). 1. You are in the Horizontal tab Settings. Go to Branches 1. Over the branch examples click on the actions icon button (the three dots) and Run Prebuild 1. Once this is Ready, click on the button New Workspace 1. Now you have the most powerful remote machine to work with Mojo.
Jack Clayton
Jack Clayton14mo ago
This is cool, thanks @Sarctiann We have a newsletter coming out soon showing things people are doing in the community. If you put this up in a gist I'll put a link to it. Thanks for sharing!
Sarctiann
SarctiannOP14mo ago
Oh great!
Sarctiann
SarctiannOP14mo ago
Gist
Gitpod-Mojo
Gitpod-Mojo. GitHub Gist: instantly share code, notes, and snippets.
Jack Clayton
Jack Clayton14mo ago
Thanks!
sa-code
sa-code14mo ago
nice It looks like you have the wrong mojo extension btw from Karsten7. I would recommend using modular-mojotools.vscode-mojo instead
Sarctiann
SarctiannOP14mo ago
Oh, that is correct! I get the official by settings sync, so I didn't notice that it was a different one haha
ModularBot
ModularBot14mo ago
Congrats @Sarctiann, you just advanced to level 5!
Sarctiann
SarctiannOP14mo ago
fixed
sa-code
sa-code14mo ago
woop woop
Jack Clayton
Jack Clayton14mo ago
Hi @Sarctiann just fyi, the draft for the first edition of the weekly newsletter was already out, I'll put this in #2 thanks!
Sarctiann
SarctiannOP14mo ago
Wow, thank you @Jack Clayton I hope this helps others!
drunkwcodes
drunkwcodes14mo ago
Wow, Mojo parade is starting!
Want results from more Discord servers?
Add your server