Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ builder:
podman build -t localhost/pullpiribuilder:latest -f containers/builder/Dockerfile-pullpiribuilder .
podman build -t localhost/pullpirirelease:latest -f containers/builder/Dockerfile-pullpirirelease .

# DO NOT USE THIS COMMAND IN PRODUCTION
.PHONY: pushbuilder
pushbuilder:
docker buildx create --name container-builder --driver docker-container --bootstrap --use
Expand Down
3 changes: 2 additions & 1 deletion containers/builder/Dockerfile-pullpirirelease
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ghcr.io/eclipse-pullpiri/pullpiribuilder:latest AS builder
# FROM ghcr.io/eclipse-pullpiri/pullpiribuilder:latest AS builder
FROM localhost/pullpiribuilder:latest AS builder
ARG TARGETARCH
WORKDIR /dummy

Expand Down
12 changes: 12 additions & 0 deletions containers/piccolo-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ spec:
- name: nodeagent
image: localhost/pullpiri-agent:latest
command: ["/piccolo/nodeagent"]
volumeMounts:
- name: piccolo-yaml
mountPath: /etc/piccolo/yaml
- name: systemd
mountPath: /etc/containers/systemd
volumes:
- name: piccolo-yaml
hostPath:
path: /etc/piccolo/yaml
- name: systemd
hostPath:
path: /etc/containers/systemd
51 changes: 29 additions & 22 deletions doc/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,28 @@ piccolo_cloud: http://0.0.0.0:41234
host:
name: HPC
ip: 0.0.0.0
type: bluechi
guest:
# - name: ZONE
# ip: 192.168.10.11
# ssh_port: 22
# id: root
# pw: rootpassword
# ip: 192.168.0.1
# type: nodeagent
dds:
idl_path: src/vehicle/dds/idl
domain_id: 100
# Removed out_dir - will use Cargo's default OUT_DIR
```

- yaml_storage : For making systemd service with podman, we need `.kube` and `.yaml` files. Lib `importer` makes these files in this directory.
- yaml_storage : For making systemd service with podman, we need `.kube` and `.yaml` files.
- piccolo_cloud : The repository address saving `Packages` and `scenarios`.
- host.name : To deliver systemd command with `bluechi`, we need node name.
- guest : Bluechi agent node information. ID/PW is required for `.kube`, `.yaml` files transfers.
- host : To deliver systemd command with `bluechi`, we need node name.
- guest : Bluechi agent node information.
- dds : will be updated.

### Pullpiri modules

Pullpiri consists of many modules.
For each modules, refer to [Structure](/doc/docs/developments.md#structure).
~~And the [example](/examples/version-display/README.md) would be helpful.~~
Examples will be updated.
And the [example](/examples/README.md) would be helpful.

## Limitations

Expand Down Expand Up @@ -77,43 +80,47 @@ For modifying configuration, see [configuration](#pullpiri-configuration).
All Pullpiri applications with test app will start in container.
If you are familiar with container, you will find it easy to use.
`Pullpiri` also uses `podman play` by default.
If this is your first time, I recommend following [Example](/examples/version-display/README.md) first.
If this is your first time, I recommend following [Example](/examples/README.md) first.

Before starting, you must build Pullpiri container image,

```sh
make builder
make image
```

*CAUTION* - A successful build requires at least 20GB of disk space.

If you have errors during `apt update`, then check dns nameserver.

For starting,

```sh
make pre install
make install
```

For stoping,

```sh
make uninstall post
make uninstall
```

You can see container list via `podman ps`.
You can see container list via `podman ps`. (infra container is omitted.)

```Text
[root@master pullpiri]# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a89293d15b18 localhost/podman-pause:5.1.2-1720678294 20 seconds ago Up 21 seconds a13f3aa439f3-service
ebce43e479be localhost/podman-pause:5.1.2-1720678294 20 seconds ago Up 21 seconds 55f9dda92972-infra
53b9a1631df9 localhost/pullpiri:0.1.0 20 seconds ago Up 20 seconds pullpiri-apiserver
cd0683bb5675 localhost/pullpiri:0.1.0 20 seconds ago Up 21 seconds pullpiri-statemanager
eb8f60534077 gcr.io/etcd-development/etcd:v3.5.11 --data-dir=/etcd-... 20 seconds ago Up 21 seconds pullpiri-etcd
9771320d5fee localhost/pullpiri:0.1.0 20 seconds ago Up 21 seconds pullpiri-gateway
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd03b211e2ac gcr.io/etcd-development/etcd:v3.5.11 --data-dir=/etcd-... 32 seconds ago Up 32 seconds 2379-2380/tcp piccolo-server-etcd
c6fbbb6feca5 localhost/pullpiri-server:latest 32 seconds ago Up 31 seconds piccolo-server-apiserver
341edada2c33 localhost/pullpiri-agent:latest 31 seconds ago Up 31 seconds piccolo-agent-nodeagent
eee2153bb581 localhost/pullpiri-player:latest 31 seconds ago Up 30 seconds piccolo-player-filtergateway
8d8011a24b43 localhost/pullpiri-player:latest 31 seconds ago Up 30 seconds piccolo-player-actioncontroller

[root@master images]# podman pod ps
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
55f9dda92972 pullpiri Running 6 minutes ago ebce43e479be 5
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
cc169812bd3e piccolo-player Degraded About a minute ago fb8974d9ba47 4
85eeff5e07cf piccolo-agent Running About a minute ago 518c9482ae00 2
809508bfdc46 piccolo-server Degraded About a minute ago 1a738d6106f0 5
```

Also refer to [Makefile](/Makefile).
201 changes: 69 additions & 132 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,94 +15,62 @@ You can also use `Docker` (but **NOT** recommend).
It is STRONGLY recommended to install
[`etcdctl`](https://github.com/etcd-io/etcd/blob/main/etcdctl/README.md)
for low-level verification.
[Download link](https://github.com/etcd-io/etcd/releases/download/v3.5.21/etcd-v3.5.21-linux-arm64.tar.gz)
: untar `tar.gz` file, you can see `etcdctl` binary.
[Download link](https://github.com/etcd-io/etcd/releases)

Download appropriate `tar.gz` and untar file, you can see `etcdctl` binary.
If you put this binary in a PATH like `/usr/bin`, you can use it without installing anything.

*Optional* :
CentOS stream (or RHEL) + Eclipse Bluechi (Maybe you will need it later)

## Make container image
## Make container image & Run Piccolo

In root folder (maybe `pullpiri`), run
Refer [Getting started](/doc/docs/getting-started.md) for launching Piccolo.
All you have to do is run `make install` and you're ready to go.

```bash
make builder
make image
```
### Check logs of containers

And then you can check

```text
podman imagse

REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/pullpiri-server latest c075222701fd About a minute ago 22.5 MB
<none> <none> 7d10b78d6046 About a minute ago 1.4 GB
localhost/pullpiri-player latest 65dec5e51782 2 minutes ago 17.7 MB
<none> <none> 00745f9dcc27 2 minutes ago 1.47 GB
localhost/pullpiri-agent latest 10621675f045 4 minutes ago 15.6 MB
<none> <none> ff941faf947e 4 minutes ago 1.38 GB
localhost/pullpirirelease latest 6fef0c340631 7 minutes ago 15.2 MB
<none> <none> 488de000d246 7 minutes ago 874 MB
localhost/pullpiribuilder latest 5a7c4a8edfa8 7 minutes ago 886 MB
```md
# [root@HPC Pullpiri]# podman logs piccolo-server-apiserver
http api listening on 0.0.0.0:47099
# [root@HPC Pullpiri]# podman logs piccolo-player-filtergateway
FilterGatewayManager init
Piccolod gateway listening on 0.0.0.0:47002
FilterGatewayManager successfully initialized
# [root@HPC Pullpiri]# podman logs piccolo-player-actioncontroller
Starting ActionController...
Starting gRPC server on 0.0.0.0:47001
gRPC server started and listening
```

## Run piccolo

Piccolo consists of many modules, so I am only going to talk about how to run
the `apiserver` (which is almost complete). The rest will be updated later.
## Run example

### Setting file
### Put Piccolo scenario into apiserver by shell script

In root folder, you can find `settings.yaml`. Currently, there is no special correction.
In this folder (`examples`), there is a `helloworld.sh` script.
Replace `NODE_NAME` in `spec:models[0]:node` with your bluechi controller node name. (My node is `HPC`)

```yaml
yaml_storage: /etc/piccolo/yaml
piccolo_cloud: http://0.0.0.0:41234
host:
name: HPC
ip: 0.0.0.0
guest:
# - name: ZONE
# ip: 192.168.0.1
```

### Start etcd container

etcd is database for piccolo.

```bash
podman run -it -d --net=host --name=piccolo-etcd \
gcr.io/etcd-development/etcd:v3.5.11 "/usr/local/bin/etcd"
```

### Start apiserver container

```bash
podman run -it -d --net=host \
-v ./src/settings.yaml:/piccolo/settings.yaml \
--name=piccolo-apiserver \
localhost/pullpiri-server:latest "/piccolo/apiserver"
```

### Check two containers

```md
# run "podman ps"
podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3dfb8ed511f gcr.io/etcd-development/etcd:v3.5.11 /usr/local/bin/et... 23 minutes ago Up 23 minutes 2379-2380/tcp piccolo-etcd
0421b70cfe13 localhost/pullpiri-server:latest /piccolo/apiserve... 22 minutes ago Up 22 minutes piccolo-apiserver

# run "podman logs -f piccolo-apiserver"
podman logs -f piccolo-apiserver
http api listening on 0.0.0.0:47099
......
---
apiVersion: v1
kind: Package
metadata:
label: null
name: helloworld
spec:
pattern:
- type: plain
models:
- name: helloworld
node: {NODE_NAME}
resources:
volume:
network:
---
......
```

### Put Piccolo scenario into apiserver by shell script

In this folder (`examples`), there is a `helloworld.sh` script.
When you run this, you call the PUT method with the apiserver's HTTP API.

```sh
Expand All @@ -111,72 +79,41 @@ When you run this, you call the PUT method with the apiserver's HTTP API.

### Check logs

If you look at the apiserver log after running the script, you will get
an error, which is caused by the lack of another module (filtergateway),
so you don't have to worry about it.
You can see `helloworld` container (is restart infinitly.)

```md
# run "podman logs -f piccolo-apiserver"
[root@HPC examples]# podman logs -f piccolo-apiserver
http api listening on 0.0.0.0:47099

thread 'tokio-runtime-worker' panicked at apiserver/src/grpc/sender/filtergateway.rs:26:10:
called `Result::unwrap()` on an `Err` value: tonic::transport::Error(Transport, ConnectError(ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# podman ps
39ab0e9e945f quay.io/podman/hello:latest /usr/local/bin/po... 6 seconds ago Exited (0) Less than a second ago helloworld-helloworld
# podman logs helloworld-helloworld
!... Hello Podman World ...!

.--"--.
/ - - \
/ (O) (O) \
~~~| -=(,Y,)=- |
.---. /` \ |~~
~/ o o \~~~~.----. ~~
| =(X)= |~ / (O (O) \
~~~~~~~ ~| =(Y_)=- |
~~~~ ~~~| U |~~

Project: https://github.com/containers/podman
Website: https://podman.io
Desktop: https://podman-desktop.io
Documents: https://docs.podman.io
YouTube: https://youtube.com/@Podman
X/Twitter: @Podman_io
Mastodon: @Podman_io@fosstodon.org
```

However, you can check if the parsing is done well through `etcdctl`.
If you want to see more information, use `podman logs` for other containers.

```text
[root@HPC examples]# etcdctl get --prefix=true ""
Model/helloworld-core ---> KEY
apiVersion: v1 ---> VALUE
kind: Model
metadata:
name: helloworld-core
annotations:
io.piccolo.annotations.package-type: helloworld-core
io.piccolo.annotations.package-name: helloworld
io.piccolo.annotations.package-network: default
labels:
app: helloworld-core
spec:
hostNetwork: true
containers:
- name: helloworld
image: helloworld
terminationGracePeriodSeconds: 0

Package/helloworld ---> KEY
apiVersion: v1 ---> VALUE
kind: Package
metadata:
label: null
name: helloworld
spec:
pattern:
- type: plain
models:
- name: helloworld-core
node: HPC
resources:
volume: null
network: null

Scenario/helloworld ---> KEY
apiVersion: v1 ---> VALUE
kind: Scenario
metadata:
name: helloworld
spec:
condition: null
action: update
target: helloworld
```
### Clear

### Delete containers after testing
In root foler,

```sh
podman rm -f piccolo-etcd
podman rm -f piccolo-apiserver
make uninstall
podman rm -f helloworld-helloworld
podman pod rm -f helloworld
```
Loading
Loading