Skip to content

Instantly share code, notes, and snippets.

@Sarctiann
Last active April 2, 2024 18:11
Show Gist options
  • Save Sarctiann/5832bbc5bd581427b2365af391c505e3 to your computer and use it in GitHub Desktop.
Save Sarctiann/5832bbc5bd581427b2365af391c505e3 to your computer and use it in GitHub Desktop.
Gitpod-Mojo
# 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"

Follow these steps

After Fork the mojo repo. and before (instead of) creating a GitHub workspace:


  1. In the root of your repo, put the .gitpod.yml file.
  2. Create .vscode/ folder and put the settings.json file inside.
  3. Commit your changes.

  1. Go to Gitpod and log in with your GitHub account.
  2. Go to Projects
  3. Create a Project by selecting your forked repo.
  4. Click on Enable Prebuilds
  5. Mark the checkbox Enable Prebuilds
  6. You are in the General tab in the sidebar. Go to Variables
  7. Create an env variable called MODULAR_AUTH with your auth token as value. (You can get it from the SDK installation page).
  8. You are in the Horizontal tab Settings. Go to Branches
  9. Over the branch examples click on the actions icon button (the three dots) and Run Prebuild
  10. Once this is Ready, click on the button New Workspace

Now you have the most powerful remote machine to work with Mojo.

{
"mojo.modularHomePath": "/home/gitpod/.modular"
}
@sa-
Copy link

sa- commented Sep 18, 2023

I would recommend using modular-mojotools.vscode-mojo instead of Karsten7.mojo-vscode

@Sarctiann
Copy link
Author

I would recommend using modular-mojotools.vscode-mojo instead of Karsten7.mojo-vscode

Thank you again @sa-
fixed

@RuKapSan
Copy link

RuKapSan commented Apr 2, 2024

How to use MODULAR_AUTH if "The auth_token argument is deprecated as of modular CLI v0.5."?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment