Add sections for peach-package-builder and peach-img-builder
This commit is contained in:
		@ -29,7 +29,9 @@
 | 
			
		||||
  - [Web Interface](./software/web_interface.md)
 | 
			
		||||
  - [Pattern Library](./software/pattern_library.md)
 | 
			
		||||
  - [Compilation](./software/compilation.md)
 | 
			
		||||
  - [Packaging](./software/packaging.md)
 | 
			
		||||
  - [Distribution](./software/distribution/index.md)
 | 
			
		||||
    - [Packaging](./software/distribution/packaging.md)
 | 
			
		||||
    - [Image Building](./software/distribution/image_building.md)
 | 
			
		||||
  - [Configuration](./software/configuration.md)
 | 
			
		||||
- [Contributor's Guide](./contributors_guide.md)
 | 
			
		||||
- [Licensing](./licensing.md)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								src/software/distribution/image_building.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/software/distribution/image_building.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
			
		||||
# PeachCloud Image Building 
 | 
			
		||||
 | 
			
		||||
PeachCloud microservices are packaged and installed onto a custom disc image running Debian,
 | 
			
		||||
using [peach-img-builder](https://github.com/peachcloud/peach-img-builder), a utility which runs on the PeachVPS. 
 | 
			
		||||
 | 
			
		||||
peach-img-builder is based off of a fork of [a vmdb2 script used for creating a Debian image for Raspberry pi](https://salsa.debian.org/raspi-team/image-specs/-/tree/master).
 | 
			
		||||
 | 
			
		||||
peach-img-builder creates a working Debian image, 
 | 
			
		||||
adds apt.peachcloud.org as an apt source,
 | 
			
		||||
and then uses peach-config to install all PeachCloud microservices.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Publishing A New Image
 | 
			
		||||
 | 
			
		||||
To build a new peach image, compress the image, and publish it to http://releases.peachcloud.org/, on the VPS run:
 | 
			
		||||
```shell
 | 
			
		||||
cd /srv/peachcloud/automation/peach-img-builder
 | 
			
		||||
./build.sh
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
This script additionally creates a manifest file listing the versions of all PeachCloud microservices included in the image.
 | 
			
		||||
The image, log of the build, and the manifest, are all copied to folder named with the current date,
 | 
			
		||||
in `/var/www/releases.peachcloud.org/html/peach-imgs/`.
 | 
			
		||||
							
								
								
									
										5
									
								
								src/software/distribution/index.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/software/distribution/index.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,5 @@
 | 
			
		||||
# Distribution
 | 
			
		||||
 | 
			
		||||
PeachCloud is distributed as a set of Debian [packages](./packaging.md) and as a disc image, 
 | 
			
		||||
which can be downloaded from http://releases.peachcloud.org.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										59
									
								
								src/software/distribution/packaging.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								src/software/distribution/packaging.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,59 @@
 | 
			
		||||
# Debian Packaging
 | 
			
		||||
 | 
			
		||||
The microservices comprising the PeachCloud software suite are packaged for easy deployment and maintainance on Debian and derivative operating systems.
 | 
			
		||||
 | 
			
		||||
Each microservice repository includes a `debian` directory which includes a `systemd` service file. `deb` packages are created using the `cargo-deb` tool ([crate](https://crates.io/crates/cargo-deb)), which installs the systemd unit file to the correct location.
 | 
			
		||||
 | 
			
		||||
**Install cargo-deb:**
 | 
			
		||||
 | 
			
		||||
`cargo install cargo-deb`
 | 
			
		||||
 | 
			
		||||
**Create the package:**
 | 
			
		||||
 | 
			
		||||
`cargo deb --target aarch64-unknown-linux-gnu`
 | 
			
		||||
 | 
			
		||||
Note: the correct linker, objcopy and strip parameters must be defined in `~/.cargo/config` for the above command to execute successfully. Visit the [Compilation](/software/compilation.md) page and look under 'Configure the linker' for more details.
 | 
			
		||||
 | 
			
		||||
**Install the package:**
 | 
			
		||||
 | 
			
		||||
`sudo dpkg -i peach-network_0.1.0_arm64.deb`
 | 
			
		||||
 | 
			
		||||
The service will be automatically enabled and started.
 | 
			
		||||
 | 
			
		||||
**Uninstall the package:**
 | 
			
		||||
 | 
			
		||||
`sudo apt-get remove peach-network`
 | 
			
		||||
 | 
			
		||||
**Remove configuration files** (not removed with `apt-get remove`):
 | 
			
		||||
 | 
			
		||||
`sudo apt-get purge peach-network`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Freight Repository 
 | 
			
		||||
 | 
			
		||||
[peach-package-builder](https://github.com/peachcloud/peach-package-builder) is a set of python scripts that run on the VPS and build all the PeachCloud microservice
 | 
			
		||||
packages and add them to the [Freight](https://github.com/rcrowley/freight) repository at apt.peachcloud.org. 
 | 
			
		||||
 | 
			
		||||
Documentation for peach-package-builder
 | 
			
		||||
cand be found [here](https://github.com/peachcloud/peach-package-builder).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Installing packages from apt.peachcloud.org
 | 
			
		||||
 | 
			
		||||
To add the PeachCloud Debian package archive as an apt source, run the following commands from your Pi:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
echo "deb http://apt.peachcloud.org/ buster main" > /etc/apt/sources.list.d/peach.list
 | 
			
		||||
wget -O - http://apt.peachcloud.org/pubkey.gpg | sudo apt-key add -
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
You can then install peach packages using apt:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
sudo apt-get update
 | 
			
		||||
sudo apt-get install peach-oled
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,29 +0,0 @@
 | 
			
		||||
# Debian Packaging
 | 
			
		||||
 | 
			
		||||
The microservices comprising the PeachCloud software suite are packaged for easy deployment and maintainance on Debian and derivative operating systems.
 | 
			
		||||
 | 
			
		||||
Each microservice repository includes a `debian` directory which includes a `systemd` service file and Debian maintainer scripts, including `postinst`, `postrm` and `prerm` scripts. These scripts define behavior for installing and uninstalling the respective services. `deb` packages are created using the `cargo-deb` tool ([crate](https://crates.io/crates/cargo-deb)).
 | 
			
		||||
 | 
			
		||||
**Install cargo-deb:**
 | 
			
		||||
 | 
			
		||||
`cargo install cargo-deb`
 | 
			
		||||
 | 
			
		||||
**Create the package:**
 | 
			
		||||
 | 
			
		||||
`cargo deb --target aarch64-unknown-linux-gnu`
 | 
			
		||||
 | 
			
		||||
Note: the correct linker, objcopy and strip parameters must be defined in `~/.cargo/config` for the above command to execute successfully. Visit the [Compilation](/software/compilation.md) page and look under 'Configure the linker' for more details.
 | 
			
		||||
 | 
			
		||||
**Install the package:**
 | 
			
		||||
 | 
			
		||||
`sudo dpkg -i peach-network_0.1.0_arm64.deb`
 | 
			
		||||
 | 
			
		||||
The service will be automatically enabled and started.
 | 
			
		||||
 | 
			
		||||
**Uninstall the package:**
 | 
			
		||||
 | 
			
		||||
`sudo apt-get remove peach-network`
 | 
			
		||||
 | 
			
		||||
**Remove configuration files** (not removed with `apt-get remove`):
 | 
			
		||||
 | 
			
		||||
`sudo apt-get purge peach-network`
 | 
			
		||||
		Reference in New Issue
	
	Block a user