Skip to content

Commit

Permalink
docs up uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 12, 2023
1 parent d902e6c commit 65ab79c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
12 changes: 6 additions & 6 deletions developer-guide/08-Custom pumps/20-writing-pump-software.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ may be provided via another system, for example an Arduino.
The first thing to do is to add a hook to your custom pump into Pioreactor's software. To do this, we attach new functions to a dosing automation that are invoked when `execute_io_action` is called. These functions will call your logic that runs the external pump. Specifically, if we wish to overwrite the `media` pump, we create a function called `add_media_to_bioreactor`, with signature

```
(cls, ml: float, unit: str, experiment: str, source_of_event: str) -> float)
(cls, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client: pioreactor.pubsub.Client) -> float)
```

To see this in an example:
Expand All @@ -30,7 +30,7 @@ class CustomPumper(DosingAutomationJob):
def __init__(self, **kwargs):
super().__init__(**kwargs)

def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str) -> float:
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
# overrides the built in add_media_to_bioreactor
# add your custom logic here. Example could be interfacing with i2c, serial, PWM, etc.
...
Expand All @@ -49,17 +49,17 @@ class CustomPumper(DosingAutomationJob):

automation_name = "custom_pumper"

def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str) -> float:
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
# overrides the built in add_media_to_bioreactor
...
return ml

def add_alt_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str) -> float:
def add_alt_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
# overrides the built in remove_waste_from_bioreactor
...
return ml

def remove_waste_from_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str) -> float:
def remove_waste_from_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
# overrides the built in remove_waste_from_bioreactor
...
return ml
Expand All @@ -83,7 +83,7 @@ class ThreePumps(DosingAutomationJob):

automation_name = "three_pumps"

def add_salty_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str) -> float:
def add_salty_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
# call an external pump, via i2c, serial, GPIO, etc.,
# or pumping_functions.add_salt_media
...
Expand Down
Binary file added static/vid/update_software_zip.mp4
Binary file not shown.
41 changes: 24 additions & 17 deletions user-guide/03-Extending your Pioreactor/20-updating-software.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slug: /updating-software
We publish new software occasionally that fixes bugs, adds new features, and improves performance. You can update your Pioreactor(s) to the latest software from the UI, or from the command line. **We highly recommend keeping your Pioreactor software up to date!**


### Method 1: Updating from the UI
### Method 1: Updating over the internet

:::info
To use this update method, you Raspberry Pi must be able to access the internet. Using a local access point, see method 2 below.
Expand Down Expand Up @@ -44,16 +44,35 @@ You can install the bleeding-edge software from this page as well. Just select t
Similarly, from the [command line](https://docs.pioreactor.com/user-guide/accessing-raspberry-pi), you can install specific versions. See `pio update app --help` for more.


### Method 2: Update using release archives

### Method 3: Update using the UI to upload a zip file

:::info
This method is used if your using the local-access-point.
Available in versions >= 23.12.11
:::

For software versions 23.10.5 and beyond, there's a new way to update your Pioreactor software.
Each time we release a new Pioreactor version, we create a bundle of the required files as a zip file. This zip file can be uploaded to your Pioreactor cluster via the UI.

1. On the [Releases page](https://github.com/Pioreactor/pioreactor/releases), download the `release_xx.xx.xx.zip` archive for the version you want.
1. On the [Releases page](https://github.com/Pioreactor/pioreactor/releases), download the `release_xx.xx.xx.zip` file for the version you want onto a computer with access to the Pioreactor web UI.

2. In the web UI, visit _Uploads_. In the drop down in the top right, select "Update from zip file".

3. Select the zip file from step 1.

4. Click update.

<div class="responsive-video">
<video controls>
<source src="/vid/update_software_zip.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
</div>


### Method 2: Update using a zip file over scp or sftp


1. On the [Releases page](https://github.com/Pioreactor/pioreactor/releases), download the `release_xx.xx.xx.zip` file for the version you want.
2. We need a software tool up upload this release to the Pioreactor.

1. You can use `scp` on the command line:
Expand Down Expand Up @@ -97,16 +116,4 @@ For software versions 23.10.5 and beyond, there's a new way to update your Piore
pios update app --source release_xx.xx.xx.zip
```
-----
To update the UI, the steps are similar:
1. On the [releases page](https://github.com/Pioreactor/pioreactorui/releases), download the `Source code (tag.gz)` for the release you want.
2. Using FileZilla, upload this archive to your leader's Raspberry Pi.
3. SSH into your Raspberry Pi, and run:
```
pio update ui --source pioreactorui-xx.xx.xx.tar.gz -v xx.xx.xx
```
where `xx.xx.xx` is the version number, (ex: `23.10.4`).
6 changes: 3 additions & 3 deletions user-guide/30-Advanced/02-remote-access/02-ngrok.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tunnels:
proto: http
addr: 80
inspect: false
basic_auth: ["pioreactor:vogue-awesome-brag"]
basic_auth: ["pioreactor:vogue-awesome-brag"] #change this
schemes:
- http
ws:
Expand All @@ -51,7 +51,7 @@ Alternatively, if you wish to set this up as a service that will launch on start
```
[remote]
# see docs at https://docs.pioreactor.com/user-guide/remote-access
ws_url=12a14e3bb.ngrok.io
ws_url=wss://12a14e3bb.ngrok.io
```

12. Save the configuration by clicking \[Save\].
Expand All @@ -63,7 +63,7 @@ ws_url=12a14e3bb.ngrok.io

Set up a domain in the ngrok UI, and follow the steps to add it to you your domain provider. Then in your `ngrok.yml`, add `hostname` fields, example:

```
```yaml
authtoken: ...
tunnels:
ui:
Expand Down

0 comments on commit 65ab79c

Please sign in to comment.