Skip to content

Commit

Permalink
Merge pull request #79 from Wakoma/split-out-orchestration
Browse files Browse the repository at this point in the history
Split out orchestration
  • Loading branch information
julianstirling authored Jul 1, 2024
2 parents 47a3348 + 6ef3ba2 commit de7f7e1
Show file tree
Hide file tree
Showing 31 changed files with 224 additions and 2,351 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Generate example docs
run: |
./generate.py
cadorchestrator generate '["NUC10i5FNH", "Raspberry_Pi_4B", "Raspberry_Pi_4B"]'
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _site/
_gb_temp_/
build/
_cache_/
server/static/builds/*
OrchestratorConfigOptions.json

.vscode/*
.venv/
Expand Down
Binary file added assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
8 changes: 8 additions & 0 deletions cadorchestration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
configuration-class:
module: nimble_orchestration.configuration
class: NimbleConfiguration
configuration-options: OrchestratorConfigOptions.json
site-title: Wakoma Nimble Configurator
site-tagline: Select Components for Your Nimble
site-logo: assets/wakoma-logo.png
site-favicon: assets/favicon.png
2 changes: 1 addition & 1 deletion devices.json.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2023 Andreas Kahler <[email protected]>
SPDX-FileCopyrightText: 2024 Wakoma

SPDX-License-Identifier: CC-BY-SA-4.0
50 changes: 29 additions & 21 deletions generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ SPDX-License-Identifier: CERN-OHL-S-2.0

Nimble hardware models are generated using Python. For CAD we used [CadQuery](https://cadquery.readthedocs.io/en/latest/intro.html). CadQuery scripts can be found in the `mechanical` directory, with individual components in the `mechanical/components/cadquery` directory. Our CadQuery scripts also use the `nimble-builder` module of helper functions.

Our preferred way to generate the models needed for a nimble configuration is via our orchestration module `nimble-orchestration`. This can be used to generate trays for networking components, nimble-rack components, and a final CAD assembly. The orchestration system uses [cq-cli](https://github.com/CadQuery/cq-cli) to execute CadQuery scripts, and [ExSource Tools](https://gitlab.com/gitbuilding/exsource-tools) to manage the process of turning scripts into useable models. The orchestration script will eventually use [GitBuilding](https://gitbuilding.io) to generate assembly manuals.
Our preferred way to generate the models needed for a nimble configuration is via our orchestration module `nimble-orchestration`. This uses an orchestration tool called [CadOrchestrator](https://gitlab.com/gitbuilding/cadorchestrator) This can be used to generate trays for networking components, nimble-rack components, and a final CAD assembly. The orchestration system uses [cq-cli](https://github.com/CadQuery/cq-cli) to execute CadQuery scripts, and [ExSource Tools](https://gitlab.com/gitbuilding/exsource-tools) to manage the process of turning scripts into useable models. The orchestration script will eventually use [GitBuilding](https://gitbuilding.io) to generate assembly manuals.


## Installation

You must have [Python 3.8](https://www.python.org/about/gettingstarted/) or higher installed on your system and also have pip installed. We recommend that you use a [Python virtual environment](https://realpython.com/python-virtual-environments-a-primer/) for interacting with nimble.
You must have [Python 3.10](https://www.python.org/about/gettingstarted/) or higher installed on your system and also have pip installed. We recommend that you use a [Python virtual environment](https://realpython.com/python-virtual-environments-a-primer/) for interacting with nimble.

Clone or download this repository to your computer

Expand All @@ -27,46 +27,54 @@ Run:

*Note, if pip doesn't work depending on your system is configured you man need to replace `pip` with `pipx`, `pip3`, or `python -m pip`.*

*Also note: The `-e` is optional. It allows you to adjust the code in `nimble-builder` or `nimble-orchestration` without having to run the installation again.*


## Running the code

As the code is very much a work in progress we do not have detailed documentation of how to run it for custom configurations.
### Lunching the configuration server

For now the best way to run the code is with the two scripts in this repository.
Starting in the root directory of this project. First you will need to generate the configuration options. To do this run:

### Generate static
gen_nimble_conf_options

The script `generate-static.py` is used to create a number of example components for a Nimble rack. The script is not trying to support any specific configuration, but is instead being developed to provide a static library interface for which a large number of Nimble components can be downloaded.
Next run:

To run this script, run the following command:
cadorchestrator serve

python generate_static.py
The server should now be available at http://127.0.0.1:8000/

This should create the `build` directory. Inside this the `printed_components` directory should contain a number of `stl` files that can be 3D printed.
### Generating a specific configuration from command line

The script also creates a simple web-page with an index of all of the files. The final link to the "Partially complete automatically generated documentation" will be broken unless you also run `generate.py` (see below).
The script `cadorchestrator generate` can be used generating a complete set of information for a nimble configuration from the command line.

It also creates a number of files that are used by the orchestration script.
Currently the configuration is just a list of the networking components which are hard coded. At a future date it should be possible to pass a configuration and other parameters to this script.

If you don't want to run this locally you can see a [hosted version of the output](https://wakoma.github.io/nimble/).
To generate run the following:

cadorchestrator generate '["NUC10i5FNH", "Raspberry_Pi_4B", "Raspberry_Pi_4B"]'

### Generate configuration
This should create the `build` directory. Inside this the `printed_components` directory should contain a number of `stl` files that can be 3D printed. It will also contain `step` files for each of these components.

The script `generate.py` is our test-bed script for generating a complete set of information for a nimble configuration.
The script also creates an `stl` and a `gltf` of the final assembled rack. **Don't print this, it is not going to print properly as a single piece!**

Currently the configuration is just a list of the networking components which are hard coded. At a future date it should be possible to pass a configuration and other parameters to this script.
It also creates a number of files that are used by the orchestration script.

At a later date this script will be improved to create a directory (and associated zip-file of each configuration).


### Generate static

The script `generate-static.py` is used to create a number of example components for a Nimble rack. The script is not trying to support any specific configuration, but is instead being developed to provide a static library interface for which a large number of Nimble components can be downloaded.

To run this script, run the following command:

python generate.py
python generate_static.py

This should create the `build` directory. Inside this the `printed_components` directory should contain a number of `step` files that can be 3D printed (you may need to convert them to `stl` files first).
This should create the `build` directory. Inside this the `printed_components` directory should contain a number of `stl` files that can be 3D printed.

The script also creates an `stl` and a `gltf` of the final assembled rack. **Don't print this, it is not going to print properly as one piece!**
The script also creates a simple web-page with an index of all of the files. The final link to the "Partially complete automatically generated documentation" will be broken unless you also run `generate.py` (see below).

It also creates a number of files that are used by the orchestration script.

At a later date this script will be improved to create a directory (and associated zip-file of each configuration).
If you don't want to run this locally you can see a [hosted version of the output](https://wakoma.github.io/nimble/).


40 changes: 0 additions & 40 deletions generate.py

This file was deleted.

6 changes: 3 additions & 3 deletions generate_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
This script generates a number of STL files and also creates
as simple website to view them. This is designed to be run
via a github action to provide a list of available STLs for
direct download without them needing to be commited to the repository
direct download without them needing to be committed to the repository
"""
import os

from nimble_orchestration.orchestration import OrchestrationRunner
from nimble_orchestration.components import GeneratedMechanicalComponent
from cadorchestrator.orchestration import OrchestrationRunner
from cadorchestrator.components import GeneratedMechanicalComponent
from nimble_orchestration.paths import BUILD_DIR, REL_MECH_DIR

def generate():
Expand Down
1 change: 0 additions & 1 deletion lint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def main():
args = parser.parse_args()
if args.file_type == "py":
lint([
'generate.py',
'generate_static.py',
'nimble_orchestration',
'nimble_builder',
Expand Down
54 changes: 0 additions & 54 deletions nimble_orchestration/assembly_def_generator.py

This file was deleted.

Loading

0 comments on commit de7f7e1

Please sign in to comment.