-
Notifications
You must be signed in to change notification settings - Fork 60
Docs: Tutorial setup maintenance #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
70b6bf3
docs: split setup into stable and edge
erinecon f2a6065
docs: rename setup to setup_stable
erinecon 9b92208
docs: add setup_edge file
erinecon 758fb8e
docs: update tutorial setup instructions
erinecon d010770
fix(docs): split up docker commands
erinecon d90795a
fix(docs): update chisel setup path
erinecon ed10624
fix(docs): update hello-world setup path
erinecon a17d28b
fix(docs): update tutorial setup paths
erinecon 73e69bd
fix(docs): update go tutorial setup
erinecon 0b49c4c
docs: restart docker
erinecon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ########################################### | ||
| # IMPORTANT | ||
| # Comments matter! | ||
| # The docs use the wrapping comments as | ||
| # markers for including said instructions | ||
| # as snippets in the docs. | ||
| ########################################### | ||
| summary: common setup instructions | ||
|
|
||
| execute: | | ||
| date | ||
| # [docs:install-rockcraft] | ||
| sudo snap install rockcraft --classic --channel latest/edge | ||
| # [docs:install-rockcraft-end] | ||
|
|
||
| # [docs:install-docker] | ||
| sudo snap install docker | ||
| # [docs:install-docker-end] | ||
|
|
||
| # [docs:docker-regular-user] | ||
| sudo addgroup --system docker | ||
| sudo adduser $USER docker | ||
| newgrp docker | ||
| # [docs:docker-regular-user-end] | ||
|
|
||
| # [docs:docker-enable] | ||
| sudo snap disable docker | ||
| sudo snap enable docker | ||
| # [docs:docker-enable-end] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| We recommend starting from a clean Ubuntu installation. If we don't have | ||
| one available, we can create one using `Multipass`_: | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. tab:: Ubuntu | ||
|
|
||
| Is Multipass_ already installed and active? Check by running | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| snap services multipass | ||
|
|
||
| If we see the ``multipass`` service but it isn't "active", then we'll | ||
| need to run ``sudo snap start multipass``. On the other hand, if we get | ||
| an error saying ``snap "multipass" not found``, then we must install | ||
| `Multipass <install-multipass_>`_: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| sudo snap install multipass | ||
|
|
||
| .. tab:: Windows | ||
|
|
||
| See `Multipass installation instructions <install-multipass_>`_, switch | ||
| to Windows in the drop down. | ||
|
|
||
| .. tab:: macOS | ||
|
|
||
| See `Multipass installation instructions <install-multipass_>`_, switch | ||
| to macOS in the drop down. | ||
|
|
||
| Then we can create the VM with the following command: | ||
|
|
||
| .. code-block:: text | ||
|
|
||
| multipass launch --disk 10G --name rock-dev 24.04 | ||
|
|
||
| Finally, once the VM is up, open a shell into it: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| multipass shell rock-dev | ||
|
|
||
| ---- | ||
|
|
||
| `LXD`_ will be required for building the rock. Make sure it is installed | ||
| and initialised: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| sudo snap install lxd | ||
| lxd init --auto | ||
|
|
||
| In order to create the rock, we'll need to install Rockcraft: | ||
|
|
||
| .. literalinclude:: /reuse/tutorial/code/edge/task.yaml | ||
| :language: bash | ||
| :start-after: [docs:install-rockcraft] | ||
| :end-before: [docs:install-rockcraft-end] | ||
| :dedent: 2 | ||
|
|
||
| This tutorial requires the ``latest/edge`` channel of Rockcraft as the | ||
| framework is currently experimental. | ||
|
|
||
| We'll use Docker to run the rock. We can install it as a ``snap``: | ||
|
|
||
| .. literalinclude:: /reuse/tutorial/code/edge/task.yaml | ||
| :language: bash | ||
| :start-after: [docs:install-docker] | ||
| :end-before: [docs:install-docker-end] | ||
| :dedent: 2 | ||
|
|
||
| By default, Docker is only accessible with root privileges (``sudo``). We want | ||
| to be able to use Docker commands as a regular user: | ||
|
|
||
| .. literalinclude:: /reuse/tutorial/code/edge/task.yaml | ||
| :language: bash | ||
| :start-after: [docs:docker-regular-user] | ||
| :end-before: [docs:docker-regular-user-end] | ||
| :dedent: 2 | ||
|
|
||
| Restart Docker: | ||
|
|
||
| .. literalinclude:: /reuse/tutorial/code/stable/task.yaml | ||
| :language: bash | ||
| :start-after: [docs:docker-enable] | ||
| :end-before: [docs:docker-enable-end] | ||
| :dedent: 2 | ||
|
|
||
| .. warning:: | ||
| There is a `known connectivity issue with LXD and Docker | ||
| <lxd-docker-connectivity-issue_>`_. If we see a | ||
| networking issue such as "*A network related operation failed in a context | ||
| of no network access*", make sure to apply one of the suggested fixes | ||
| `here <lxd-docker-connectivity-issue_>`_. | ||
|
|
||
| Note that we'll also need a text editor. We can either install one of our | ||
| choice or simply use one of the already existing editors in the Ubuntu | ||
| environment (like ``vi``). | ||
|
|
||
| .. _`lxd-docker-connectivity-issue`: https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker | ||
| .. _`install-multipass`: https://multipass.run/docs/install-multipass | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.