GithubHelp home page GithubHelp logo

balena-io / docs Goto Github PK

View Code? Open in Web Editor NEW
68.0 36.0 336.0 218.22 MB

Documentation for the balenaCloud platform.

Home Page: https://docs.balena.io/

License: Apache License 2.0

CSS 17.85% JavaScript 9.48% HTML 51.48% CoffeeScript 10.36% Makefile 0.19% Shell 10.65%
balenacloud docs hacktoberfest

docs's Introduction

balenaCloud Documentation

GitHub tag GitHub issues GitHub License

Documentation for the balenaCloud platform lives here.
Join our forums to chat.

This repo intends to provide our public-facing documentation. To view the documentation generated by this repo, one could either run locally or view the hosted version.

Getting Started

To get started for contributing to balenaCloud documentation, follow the steps below:

git clone https://github.com/balena-io/docs.git
cd docs
npm install
npm run build

Now to check that everything is working correctly, start the local server with:

npm start

You should now see the docs served from http://localhost:3000/docs running locally on your device. Running locally helps in seeing the preview of your changes quickly to improve changes.

Note: if you are using macOS and you get "RangeError: Maximum call stack size exceeded" when running npm install (which eventually calls the build.sh script), have a look at the comments at the top of the "Dockerfile.bindmount" file.

To add you changes to the docs, create a new local branch of master:

git checkout -b my-docs-patch

Now you can make changes to this branch. The docs are generated from markdown files as static pages using metalsmith.io. Hence, each time any changes are made .md files, a rebuild needs to be triggered to generate the static pages again. One can quickly rebuild using the command:

npm run build:fast

This command will skip over downloading files from external sources, which takes a while. However, there is a handy watch functionality that will watch for changes in /pages, /shared, and /templates and rebuild each time any changes are made. To use this, open a new tab in your terminal and run:

npm run watch-pages

Once you are satisfied with the changes, make the commits, push the changes and submit a pull request for your branch against master. Make sure to read the CONTRIBUTING document before committing.

Note that you have to restart the development server if you edit other things like redirects.txt.

How to Contribute

If you think a part is not documented, is outdated, or can be improved on the docs, don't hesitate to send a PR! Check our CONTRIBUTING document for the guidelines to ensure your PR can be merged as quickly as possible. One can open or check existing issues on GitHub issues. Looking forward to seeing your contributions!

Pro tip: Use the "Improve This Doc" button to make changes to the correct file.

Improve-this-doc-button

Deploying

Shortly after merging a PR to the master branch, Flowzone will run on the deploy script npm run deploy-docs on master branch and deploy the docs on balenacloud-docs.pages.dev.

The docs are hosted on Cloudflare Pages as a static site.

Style manual

Balena-specific words

For all instances, we use balena as lower-case capitalization unless beginning a sentence (Ex. I like balena. Balena is great.). More instances as follows,

  • balena (used to refer to the company as a whole, not in place of balenaCloud, balenaOS or any other project)
  • balenaEtcher
  • balenaOS (note the capitalization of OS)
  • balenaEngine
  • balenaFin
  • balenaCloud
  • the balena CLI
  • the balena Supervisor
  • openbalena

Conventions & Best Practices

  • Notes/Warnings are formatted using CSS. Use the following syntax to make sure it's rendered correctly: __Note:__

  • It's important to note that h1 and h2 headings will automatically be included on the left sidebar, so make sure to use these appropriately and sparingly.

  • We also use globally accessible variables to interpolate strings, reuse variables easily and maintain consistency across the documentation to follow a consistent naming convention.

  • Module containing the variable can be found /config directory with several modules for links, names, etc. containing references being used across the documentation. These references can be used inside the documentation files using fluid tags like the examples below.

  1. Reusing commonly used names as variables - Deploy with {{ $names.company.lower }}
  2. Interpolating strings - {{ $names.os.lower }} image configured
  3. Even, building links - {{ $links.githubLabs }}/multicontainer-getting-started/tree/master/haproxy

Using Partials

When creating new content or altering current pages, it's recommended to try and keep things DRY (Don't Repeat Yourself). This is accomplished in the balenaCloud documentation by using "partials". The sub-directories of the/shared folder contain snippets or partials of the docs, which can be reused anywhere in the documentation. They also allow you to cleverly override a partial for a particular board type and language type. In general, most of them contain a _default.md, which means the default partial will be used for all boards and language types. But, for partials for sections like getDeviceOnDash has device-specific overrides such as the one below.

├── getDeviceOnDash
│   ├── _default.md
│   ├── artik10.md
│   ├── artik5.md
│   ├── raspberrypi.md
│   ├── raspberrypi2.md
│   └── raspberrypi3.md

To use these partials in a markdown page, all you need to do is add the following onto the page:

{{ import “getDeviceOnDash” }}

On build time, the engine will pull that partial into this location on the page. This way, pages can be generated dynamically based on specific conditions, much like the Getting Started docs.

Using Templates

In dynamically generated pages (the ones with the device-type and language dropdown), it is possible to use templates to dynamically change the device name and language name in your text.

Here is an example:

Getting started with {{ $device.name }} using {{ $language.name }}

Select the {{ $device.name }} device type`

To add additional dynamic properties, see the files in /config/dictionaries. To learn more about dynamically generated pages, see the README for the Doxx project, which is used to generate those pages for the balenaCloud documentation.

License

The project is licensed under the Apache 2.0 license.

docs's People

Contributors

acostach avatar alexgg avatar andrewnhem avatar balena-ci avatar brownjohnf avatar chrisys avatar dansku avatar dependabot[bot] avatar dimitrisnl avatar emirotin avatar flowzone-app[bot] avatar garethtdavies avatar imrehg avatar james2710 avatar kb2ma avatar klutchell avatar lekkas avatar lorenzo-stoakes avatar milosh012 avatar nghiant2710 avatar page- avatar pdcastro avatar rahul-thakoor avatar rhampt avatar shaunmulligan avatar sradevski avatar thgreasi avatar vipulgupta2048 avatar xginn8 avatar zwalchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Document using host Systemd calls in the container through dbus.

1.) apt-get install dbus (in your dockerfile)
2.) make sure systemd is running in the container, this is done by setting the environment variable INITSYSTEM = on
3.) run the following command from your start shell script:
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host_run/dbus/system_bus_socket dbus-send --system --print-reply --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.Reboot

Document "Config Vars"

The Config Vars section in Dashboard is a generic interface to set special variables from. It currently lacks docs describing its use.

link broken

broken link to node.js here: "This is a simple Hello, World project for [node.js][node] designed"

Add info about disk partitioning

A user once asked what we do to their boards disk / HDD, what are partitions and what are their sizes
We should doc it

Here's the info from Ted:

  1. Boot partition
  2. Rootfs partition
  3. Update partition
  4. Expanded partion (this just holds 5 and 6)
  5. Configuration partition (config.json here)
  6. Data partition (this expands at boot till it fills the entire memory medium also holds all the user data)

Document supervisor update strategies

Via adding an env var RESIN_SUPERVISOR_UPDATE_STRATEGY, current options

  • download-then-kill (default)
  • kill-then-download
  • hand-over

Requires supervisor >= 1.3.0

Update info on Changing SSID and/or Passphrase

In this section:

http://docs.resin.io/#/pages/deployment/wifi.md#changing-your-ssid-and-or-passphrase

the instructions state that changing the wifi ssid/passphrase in Beaglebone (and other board) is only possible before provisioning the device. In fact, there is a way to do it (though rough) and users have done it anyway in at least one occasion.

A possible change would be to mention that a method exists, though it is untested (or even not recommended)

Suggest power cleaning devices

By 'power cleaning' I mean surge protection, uninterruptible supply, devices that clean up the power signal provided, etc.

This is because devices like the rpi are very sensitive to power fluctuations and it can cause serious issues if they occur, esp. surges.

document custom boot splash screen

Customizing splash

We configure all of our initial images to produce a resin logo at boot, shutdown or reboot. But we encourage any user to go and replace that logo with their own. All you have to do is replace the splash/resin-logo.png file that you will find in the first partition of our images (boot partition) with your own image. NOTE: As it currently stands plymouth expects the image to be named resin-logo.png.

Front logo Front conversations

Update strategies docs unclear

  • Need to mention what agent version works for update strategies.
  • Also need to mention that these need to be set in the APPLICATION CONFIG VARIABLES section not in regular env vars

I2C workaround

A feedback from the user (https://app.intercom.io/a/apps/yg02r5dz/inbox/conversation/1606996671)

http://docs.resin.io/#/pages/hardware/i2c-and-spi.md#i2c
"After your first push, the code will most likely throw an error caused by the modules not being loaded. If this is the case, simply reboot the pi and the modules should be loaded."
I have exactly the same issue on first boot.
Here is my workaround:

# show what i2c buses are available, and grant file permissions 
for i in "$(/usr/sbin/i2cdetect -l | cut -f1)"; do 
# reboot to work around issue discussed here: 
# http://docs.resin.io/#/pages/hardware/i2c-and-spi.md 
/usr/sbin/i2cdetect -y "$(cut -f2 -d '-' <<< $i)" || curl -X POST --header "Content-Type:application/json" \
--data "{"appId": "$APP_ID"}" \ 
"${RESIN_SUPERVISOR_ADDRESS}/v1/restart?apikey=${RESIN_SUPERVISOR_API_KEY}" 
chown "${APP_USER}" "/dev/${i}" 
done

This happens to work like charm 😀

Better docs for BBB capemgr use

We need some more/better documentation on using the capemgr and loading capes...some examples of using UART and SPI would be very useful.

Some example stuff from a previous user issue:

Here are the commands to load the cape for UART 1,2,4 and 5 , check it and unload:

root@beaglebone:~# echo BB-UART1 > /sys/devices/platform/bone_capemgr/slots          
root@beaglebone:~# echo BB-UART2 > /sys/devices/platform/bone_capemgr/slots          
root@beaglebone:~# echo BB-UART4 > /sys/devices/platform/bone_capemgr/slots 
root@beaglebone:~# echo BB-UART5 > /sys/devices/platform/bone_capemgr/slots 
root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 
 5: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-UART1
 6: P-O-L-   1 Override Board Name,00A0,Override Manuf,BB-UART2
 7: P-O-L-   2 Override Board Name,00A0,Override Manuf,BB-UART4
 8: P-O-L-   3 Override Board Name,00A0,Override Manuf,BB-UART5
root@beaglebone:~# echo -5 > /sys/devices/platform/bone_capemgr/slots
root@beaglebone:~# echo -6 > /sys/devices/platform/bone_capemgr/slots
root@beaglebone:~# echo -7 > /sys/devices/platform/bone_capemgr/slots
root@beaglebone:~# echo -8 > /sys/devices/platform/bone_capemgr/slots
root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1 
 1: PF----  -1  2: PF----  -1 
 3: PF----  -1

Front logo Front conversations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.