mirror of
https://github.com/Start9Labs/documentation.git
synced 2026-03-26 10:21:53 +00:00
re-arrange the user docs (#76)
* re-arrange the user docs * Minor description edit * update styles * fix service links Co-authored-by: kn0wmad <kn0wmad@protonmail.com> Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
.. _environment-setup:
|
||||
|
||||
===========================
|
||||
Packaging Environment Setup
|
||||
===========================
|
||||
|
||||
To get started packaging a service for EmbassyOS, some basic knowledge of software development is required. Don't worry if you are inexperienced, we will provide enough context to get you started, and you can always reach out with questions.
|
||||
|
||||
If you are already an experienced developer, :ref:`jump ahead <environment-quick-start>`.
|
||||
|
||||
The only system requirements are `Docker <https://docs.docker.com/get-docker>`_ and `Cargo <https://doc.rust-lang.org/cargo/>`_ (Rust package manager).
|
||||
|
||||
Of course, there are additional recommendations that would streamline your development experience, but they are not required.
|
||||
|
||||
Code Editor
|
||||
-----------
|
||||
|
||||
A code editor is recommended since you will, after all, be writing code! We are fans of `Visual Studio Code <https://code.visualstudio.com/>`_ . Visual Studio Code is a free, batteries-included text editor made by Microsoft.
|
||||
|
||||
Terminal / CLI
|
||||
--------------
|
||||
|
||||
We recommend using your computer's built-in terminal as a command line interface (CLI) for your operating system. For Windows users, we recommend the built-in command line (cmd) *Command Prompt* or the Powershell CLI, running in Administrator mode. For macOS and Linux, the native *Terminal* is recommended, but virtually any terminal will work.
|
||||
|
||||
If you are new to the command line, Ionic has published this awesome `guide <https://ionicframework.com/blog/new-to-the-command-line/>`_ to get you started.
|
||||
|
||||
.. _environment-setup-git:
|
||||
|
||||
Git
|
||||
---
|
||||
|
||||
Although not required, the version control system Git is highly recommended.
|
||||
|
||||
Git is often accompanied by a Git Host, such as `GitHub <https://github.com/>`_, in which case additional setup is required. Follow the tutorial from the GitHub `here <https://docs.github.com/en/get-started/quickstart/set-up-git>`_ to set up your environment.
|
||||
|
||||
To verify the installation, open a new terminal window and run:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
git --version
|
||||
|
||||
Docker
|
||||
------
|
||||
|
||||
`Docker <https://docs.docker.com/get-docker>`_ must be installed to your computer platform. It is needed to build an image for your package, which will be used to create the running instance of your package on EmbassyOS. In essence, it declares the necessary environment and building stages for your package to run.
|
||||
|
||||
We also recommend installing and using `Docker buildx <https://docs.docker.com/buildx/working-with-buildx/>`_, as this adds desirable new features to the Docker build experience. It is included by default with Docker Desktop for Windows and macOS.
|
||||
|
||||
|
||||
Cargo
|
||||
-----
|
||||
|
||||
Cargo is the package management solution for the Rust programming language. It will install Rust to your system, and provide the required environment to build the Embassy SDK for packaging your service into the required format needed by EmbassyOS.
|
||||
|
||||
Installation instructions for Cargo can be found `here <https://doc.rust-lang.org/cargo/getting-started/installation.html>`__.
|
||||
|
||||
To verify the installation, open a terminal window and run:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
cargo --version
|
||||
|
||||
SDK
|
||||
---
|
||||
|
||||
EmbassyOS provides a :ref:`software development kit <sdk>` embedded in its environment. You do not need a running instance of EmbassyOS to use this component, it can be installed on any computer platform.
|
||||
|
||||
To install the SDK:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
git clone https://github.com/Start9Labs/embassy-os.git
|
||||
cd backend
|
||||
./install-sdk.sh
|
||||
|
||||
To verify the installation, open a terminal window and run:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
embassy-sdk --version
|
||||
|
||||
EmbassyOS
|
||||
---------
|
||||
|
||||
While not strictly necessary, having a running instance of EmbassyOS is recommended to test installing, running, configuring, and using your package. Without this component, you will have to coordinate with Start9's internal development team to test.
|
||||
|
||||
.. _environment-quick-start:
|
||||
|
||||
Quick Start Environment Setup
|
||||
-----------------------------
|
||||
- `Docker <https://docs.docker.com/get-docker>`_
|
||||
- `Docker buildx <https://docs.docker.com/buildx/working-with-buildx/>`_
|
||||
- `Cargo <https://doc.rust-lang.org/cargo/getting-started/installation.html>`__
|
||||
- `EmbassyOS <https://github.com/Start9Labs/embassy-os>`_
|
||||
- `Embassy SDK <https://github.com/Start9Labs/embassy-os/blob/master/backend/install-sdk.sh>`_
|
||||
63
site/source/developer-docs/getting-started/index.rst
Normal file
63
site/source/developer-docs/getting-started/index.rst
Normal file
@@ -0,0 +1,63 @@
|
||||
.. _packaging-getting-started:
|
||||
|
||||
========================
|
||||
Getting Started Overview
|
||||
========================
|
||||
|
||||
Select an option below to get started with packing a service for EmbassyOS.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div class="topics-grid grid-container full">
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
|
||||
.. topic-box::
|
||||
:title: Environment Setup
|
||||
:link: environment-setup
|
||||
:icon: scylla-icon scylla-icon--integrations
|
||||
:class: large-4
|
||||
:anchor: View
|
||||
|
||||
Get your environment setup to optimize service packaging
|
||||
|
||||
.. topic-box::
|
||||
:title: Build your first Package
|
||||
:link: build-package-example/index
|
||||
:icon: scylla-icon scylla-icon--open-source
|
||||
:class: large-4
|
||||
:anchor: Begin
|
||||
|
||||
Follow along to learn packaging fundamentals with an example
|
||||
|
||||
.. topic-box::
|
||||
:title: Packaging Quick Start
|
||||
:link: packaging-quick-start
|
||||
:icon: scylla-icon scylla-icon--roadmap
|
||||
:class: large-4
|
||||
:anchor: Begin
|
||||
|
||||
Quickly get started with concise packaging steps
|
||||
|
||||
.. topic-box::
|
||||
:title: SDK
|
||||
:link: sdk
|
||||
:icon: scylla-icon scylla-icon--apps
|
||||
:class: large-4
|
||||
:anchor: View
|
||||
|
||||
Discover details about Start9's Software Development Kit
|
||||
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div></div>
|
||||
|
||||
.. This is for the side navigation display
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
environment-setup
|
||||
sdk
|
||||
quick-start
|
||||
33
site/source/developer-docs/getting-started/quick-start.rst
Normal file
33
site/source/developer-docs/getting-started/quick-start.rst
Normal file
@@ -0,0 +1,33 @@
|
||||
.. _packaging-quick-start:
|
||||
|
||||
=====================
|
||||
Packaging Quick Start
|
||||
=====================
|
||||
|
||||
This guide outlines a checklist of steps to complete in order to package a service for EmbassyOS. For a more in depth example, visit the :ref:`build your first package <build-package-example>` guide.
|
||||
|
||||
Packaging
|
||||
---------
|
||||
|
||||
1. Create or select project
|
||||
2. Build project
|
||||
3. Cross compile for armv8/aarch64 if necessary
|
||||
4. Create Dockerfile and docker entrypoint file
|
||||
5. Add build steps, compiled executables, assets, etc in Dockerfile and specify run command in docker entrypoint, handling signal exiting if the service does not already do this gracefully
|
||||
6. Create Manifest file
|
||||
7. Create instructions file
|
||||
8. Create icon file
|
||||
9. Add license
|
||||
10. Package all components into s9pk using embassy-sdk
|
||||
11. Verify package components using embassy-sdk
|
||||
12. Create a wrapper repository on GitHub to host all package assets for review
|
||||
13. (Optional) Add all package build steps to a Makefile for replicability
|
||||
|
||||
Testing:
|
||||
--------
|
||||
|
||||
1. Sideload ``<package-id>.s9pk`` onto an Embassy
|
||||
2. Install package using embassy-cli
|
||||
3. Start package using embassy-cli, or in the UI
|
||||
4. Check logs to see if errors
|
||||
5. Ensure service is reachable/launchable
|
||||
97
site/source/developer-docs/getting-started/sdk.rst
Normal file
97
site/source/developer-docs/getting-started/sdk.rst
Normal file
@@ -0,0 +1,97 @@
|
||||
.. _sdk:
|
||||
|
||||
===========
|
||||
Embassy SDK
|
||||
===========
|
||||
|
||||
Embassy SDK, or Software Development Kit, is a CLI (Command Line Interface) tool that aids in building and packaging services you wish to deploy to the Embassy.
|
||||
|
||||
It mainly helps you validate that the necessary components of your package exist, and package all of those components into a special file type that is understood by EmbassyOS.
|
||||
|
||||
To install, checkout the SDK step in :ref:`setting up your environment <environment-setup>`.
|
||||
|
||||
Commands
|
||||
========
|
||||
|
||||
To see a list of all available commands provided, run the following from an terminal window:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
embassy-sdk --help
|
||||
|
||||
|
||||
embassy-sdk init
|
||||
----------------
|
||||
|
||||
Initialize the developer key for interacting with the SDK.
|
||||
|
||||
By default, this creates the developer key at `/etc/embassy`. You might need to change ownership of this folder depending on your system permissions.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
chown <user> /etc/embassy
|
||||
|
||||
Alternatively, you can write a config file with your desired developer location, it simply needs the following format:
|
||||
|
||||
.. code:: yaml
|
||||
|
||||
developer-key-path: /desired/path/to/key
|
||||
|
||||
And load it by running:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
embassy-sdk -c /path/to/config init
|
||||
|
||||
|
||||
embassy-sdk pack
|
||||
----------------
|
||||
|
||||
This command takes the necessary package components and assembles them into the `s9pk` file format needed to install a service on EmbassyOS. It expects the following files to exist:
|
||||
|
||||
- Manifest
|
||||
- Instructions
|
||||
- License
|
||||
- Icon
|
||||
|
||||
If this command fails, the error response will indicate which component is missing.
|
||||
|
||||
embassy-sdk verify
|
||||
-------------------
|
||||
|
||||
This command verifies aspects about the components assembled into the `s9pk`, such as:
|
||||
|
||||
- Ensures that all mounts are real volumes in the manifest
|
||||
- Ensures all cert volumes point to real interfaces in the manifest
|
||||
- Ensures all actions refer to real images in the manifest
|
||||
- Ensures all images are tagged correctly in the manifest
|
||||
- Ensures the icon is less than 100KB
|
||||
|
||||
It should be run _after_ `embassy-sdk pack` in order to verify the validity of each component.
|
||||
|
||||
If this command fails, the error message will indicate the mismatched details.
|
||||
|
||||
embassy-sdk git-info
|
||||
--------------------
|
||||
|
||||
This command outputs the git commit hash of the SDK version installed on your platform.
|
||||
|
||||
embassy-sdk inspect
|
||||
-------------------
|
||||
|
||||
This command contains several utilities for reading components once packaged into the `s9pk`. In development, it can be helpful to determine if each component is successfully included in the `s9pk` package.
|
||||
|
||||
It contains the following subcommands, and requires the path to the `<pacakge-id>.s9pk` file as the last argument:
|
||||
|
||||
- docker-images
|
||||
- hash
|
||||
- icon
|
||||
- instructions
|
||||
- license
|
||||
- manifest
|
||||
|
||||
For example:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
embassy-sdk inspect instructions /path/to/<package-id>.s9pk
|
||||
Reference in New Issue
Block a user