Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
202ff89
tasksv2 rebase
Jan 4, 2022
91809f1
fix tests
Jan 4, 2022
e91cfb4
fix lint errors
Jan 4, 2022
d8250d8
proper db model for task logs; add querying by time
Jan 5, 2022
db4b609
update task sub route; fix tests
Jan 5, 2022
cb608a8
update internal ws app
Jan 5, 2022
3f4c9e2
improve db model
Jan 5, 2022
7556654
fix race condition with subscribing current state and subscribe succe…
Jan 5, 2022
e0f512c
fix lint errors
Jan 5, 2022
7b20b8e
fix race condition in other routes
Jan 5, 2022
844b006
fix lint errors
Jan 5, 2022
9b0a6eb
make log enums compatible with pydantic
Jan 6, 2022
cb70b95
move fleet logs to proper relational schema
Jan 6, 2022
a195122
fix state updates not being filtered
Jan 6, 2022
cc42ef7
fix race conditon in health subscriptions
Jan 6, 2022
4f6f459
cleanup
Jan 6, 2022
0b8725d
do not automatically source ros
Jan 7, 2022
f639765
clean dir before generating
Jan 7, 2022
39aa40e
run datamodel-codegen in sub shell to avoid tainting the current shell
Jan 7, 2022
ef655f2
update models with fixed task logs
Jan 10, 2022
9e6287b
squash merge of prototype/fix/user-interface
Jan 10, 2022
35f60d5
update models
Jan 10, 2022
c5709dd
build deps and start rmf
Jan 10, 2022
1f04aa3
return helpful error when request has invalid query
Jan 10, 2022
0b94ab9
fix missing imports and add some logging
Jan 10, 2022
e4a5c7f
dashboard build success
Jan 10, 2022
70a5970
support task dispatch, cancellation, discovery etc
Jan 14, 2022
d3f5f97
add debug printouts
Jan 14, 2022
b964fea
use ros clock
Jan 14, 2022
d974b40
build: tasksv2/better dev defaults (#568)
Jan 18, 2022
15c1108
change query fleets endpoint to get all fleets
Jan 19, 2022
f4e981b
generate task description models
Jan 19, 2022
8aecc89
task states and logs do not inherit generated models so there will no…
Jan 19, 2022
4e3f02e
do not allow usernames starting with _
Jan 19, 2022
ec903fc
some fixes and disabling tests that are not working
Jan 19, 2022
e5a2711
update models
Jan 19, 2022
38e57d2
remove todo
Jan 24, 2022
d6f5e22
port create task form
Jan 27, 2022
68e9a25
fix wrong mock return
Jan 27, 2022
63368d3
fix loop places
Jan 27, 2022
659ff0e
add priority type binary
Jan 27, 2022
d86472a
call api_request service only once
cnboonhan Jan 27, 2022
837362c
Get the correct field
cnboonhan Jan 27, 2022
3f1ae41
Use RobotState instead of VerboseRobot data structure
cnboonhan Jan 27, 2022
3ca5003
fix wrong category stored
Jan 28, 2022
b3ac7a4
add debug logging to RmfService
Jan 28, 2022
a1dd89e
fix the fixed task dispatch resp handling
Jan 28, 2022
4330f5c
Fix outdated note in README
mxgrey Feb 3, 2022
da08134
fix wrong response from post dispatch task
Feb 4, 2022
34798e1
cleanup excessive logging on rmf_gateway_app
Feb 7, 2022
cf946fd
Merge remote-tracking branch 'origin/main' into prototype/tasks_v2-2
Feb 9, 2022
9f4241b
Merge remote-tracking branch 'origin/main' into prototype/tasks_v2-2
Feb 9, 2022
1643995
Support flexible task definitions (#573)
mayman99 Feb 13, 2022
55e45c9
fix build error
Feb 16, 2022
eaaa3ae
fix parsing of dispatch task response
Feb 16, 2022
9d79b93
update datamodel codegen
Feb 16, 2022
1ca61f5
update openapi gen and models
Feb 16, 2022
f68c704
fix wrong payload for cancel task request
Feb 16, 2022
9d51b77
Prototype/tasks v2 2 merge prune robot panel (#581)
cnboonhan Feb 16, 2022
9dec007
re-enable skipped test
Feb 16, 2022
b06b85c
fix task cancellation in dashboard
cnboonhan Feb 16, 2022
ed6995d
refactored robot components, wip fixing locales
Feb 16, 2022
cdc68ae
add time endpoint
Feb 16, 2022
f87b0df
rudimentary working delivery panel
cnboonhan Feb 16, 2022
b31aedf
Merge branch 'prototype/tasks_v2-2' of github.com:open-rmf/rmf-web in…
Feb 17, 2022
80dcaba
fix tests
Feb 17, 2022
5d50ab2
fix robot page on dashboard
Feb 17, 2022
240b1f9
memomize some components for perf
Feb 17, 2022
d90c3fe
remove use of common-subscriptions as they are on the chopping block
Feb 17, 2022
60acae8
add tests
Feb 18, 2022
310b833
update puppeteer
Feb 18, 2022
f7699c7
fix auto refresh in task page
Feb 20, 2022
aca190e
add auto refresh to tasks panel and tasks components
Feb 20, 2022
5eb0ffc
fix missing dep in useEffect
Feb 20, 2022
8da47da
update task logs in react-components
Feb 21, 2022
1ca6b34
Merge branch 'prototype/tasks_v2-2' of github.com:open-rmf/rmf-web in…
Feb 21, 2022
9cc9e30
update tests
Feb 21, 2022
5872904
export openapi schema
Feb 21, 2022
a128609
use ajv to validate input file
Feb 21, 2022
5d8df0d
fix build
Feb 21, 2022
60538f6
fix use of any type
Feb 21, 2022
bcf14d6
fix example deployment
cnboonhan Feb 24, 2022
c173b1d
fix routing for reporting server
cnboonhan Feb 24, 2022
097671d
Merge branch 'main' into prototype/tasks_v2-2-fix-example-deployment
cnboonhan Feb 24, 2022
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
13 changes: 9 additions & 4 deletions example-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ others:
For this example we will be using [rmf_demos](https://github.com/open-rmf/rmf_demos) as a local "deployment" of RMF, check that you have a working installation with

```bash
ros2 launch rmf_demos_gz office.launch.xml
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 launch rmf_demos_gz office.launch.xml
```

## kubernetes
Expand Down Expand Up @@ -276,9 +276,10 @@ The jobs we will run in this example can be found at `k8s/example-full/cronjobs.
## Test the deployment

If not done so already, launch the office demo
NOTE: Due to DDS challenging behavior with minikube over NAT, we will use `rmw_fastrtps_cpp` to bypass NAT traversal using sharede memory transport.

```bash
ros2 launch rmf_demos_gz office.launch.xml headless:=true
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 launch rmf_demos_gz office.launch.xml headless:=1 use_sim_time:=false server_uri:=ws://example.com:8001
```

Go to https://example.com/dashboard, if everything works, you should see a log in screen, use user=example, password=example.
Expand All @@ -292,7 +293,7 @@ It can be very useful to automate everything mentioned above and instantly deplo
Before you run the script, first you have to obtain the source. Refer to the above instructions if you don't know how to do it. You should have a git repo for rmf-web and a colcon workspace for rmf, then just run

```bash
./deploy.sh --rmf-ws <path-to-rmf-ws> --rmf-web-ws <path-to-rmf-web-ws>
./deploy.sh <path-to-rmf-ws> <path-to-rmf-web-ws>
```

Note: If you followed the above instructions to obtain the source, your rmf workspace will be in `ws/rmf`, and your rmf-web workspace will be in `ws/rmf-web`. So you will run it with `./deploy.sh --rmf-ws ws/rmf --rmf-web-ws ws/rmf`.
Expand Down Expand Up @@ -399,7 +400,11 @@ If you can connect to rmf, there is a chance that there is some discovery issues

## Some containers crashes at first startup

Some deployments like the rmf-server may crash on the first startup, this is often due to the database not being ready yet. This is normal and kubernetes will automatically restart the container.
Some deployments like the rmf-server may crash on the first startup, this is often due to the database not being ready yet. This is normal and kubernetes will automatically restart the container. Alternatively, you can forcefully terminate the rmf-server to force a restart:
```
kubectl get pods
kubectl delete pods [rmf-server-xxxx]
```

One solution is to add an init container to probe for the readiness of the database, but this comes at a small cost which is not normally expected to happen in an actual deployment. It is also not fail proof as there is no guarantee that

Expand Down
1 change: 0 additions & 1 deletion example-deployment/build-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cd $root_dir
mkdir -p build/builder/

cd $1
cp lerna.json "$root_dir/build/builder/"
find . -name node_modules -prune -o -name build -prune -o \
\(\
-name 'package*.json' -o \
Expand Down
2 changes: 1 addition & 1 deletion example-deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ echo '🗒 setting up apps and users'
try() {
"$@" || (sleep 1 && "$@") || (sleep 5 && "$@")
}
try node keycloak-tools/bootstrap-keycloak.js
try node keycloak-tools/bootstrap-keycloak.js || true # persistent keycloak database might fail this script if it has already been run before
try node keycloak-tools/get-cert.js > k8s/example-full/keycloak/keycloak.pem
openssl x509 -in k8s/example-full/keycloak/keycloak.pem -pubkey -noout -out k8s/example-full/keycloak/jwt-pub-key.pub
echo '✅ successfully setup keycloak'
Expand Down
2 changes: 0 additions & 2 deletions example-deployment/docker/dashboard.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ ARG BUILDER_TAG
FROM rmf-web/builder:$BUILDER_TAG

COPY . /root/rmf-web
RUN cd /root/rmf-web && \
lerna run prepare --include-dependencies --scope=rmf-dashboard

ARG PUBLIC_URL
ARG REACT_APP_TRAJECTORY_SERVER
Expand Down
39 changes: 0 additions & 39 deletions example-deployment/docker/dashboard.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion example-deployment/docker/reporting-server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM rmf-web/builder:$BUILDER_TAG

COPY . /root/rmf-web
RUN cd /root/rmf-web && \
lerna run prepare --include-dependencies --scope=reporting-server && \
cd packages/reporting-server && \
npm run prepack

Expand Down
6 changes: 0 additions & 6 deletions example-deployment/docker/reporting.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ ARG BUILDER_TAG
FROM rmf-web/builder:$BUILDER_TAG

COPY . /root/rmf-web
RUN cd /root/rmf-web && \
lerna run prepare --include-dependencies --scope=reporting

ARG PUBLIC_URL
ARG REACT_APP_REPORTING_SERVER
Expand Down Expand Up @@ -31,10 +29,6 @@ RUN echo -e 'server {\n\
index index.html index.htm;\n\
try_files $uri /reporting/index.html;\n\
}\n\
\n\
location /reporting/static/ {\n\
expires 30d;\n\
}\n\
\n\
error_page 500 502 503 504 /50x.html;\n\
location = /50x.html {\n\
Expand Down
7 changes: 4 additions & 3 deletions example-deployment/docker/rmf-server.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM rmf-web/rmf-server:build as stage0

FROM ros:foxy-ros-base-focal
FROM ros:galactic

SHELL ["bash", "-c"]

Expand All @@ -15,7 +15,8 @@ COPY rmf/rmf_internal_msgs/rmf_traffic_msgs /root/rmf_ws/src/rmf_traffic_msgs
COPY rmf/rmf_internal_msgs/rmf_workcell_msgs /root/rmf_ws/src/rmf_workcell_msgs
COPY rmf/rmf_building_map_msgs /root/rmf_ws/src/rmf_building_map_msgs

RUN . /opt/ros/foxy/setup.bash && cd /root/rmf_ws && \
RUN apt update && apt install -y ros-galactic-rmw-fastrtps-cpp
RUN . /opt/ros/galactic/setup.bash && cd /root/rmf_ws && \
colcon build --merge-install --install-base /opt/rmf --cmake-args -DCMAKE_BUILD_TYPE=Release && \
rm -rf /root/rmf_ws

Expand All @@ -27,6 +28,6 @@ RUN cd /root/rmf-server && \

RUN echo -e '#!/bin/bash\n\
. /opt/rmf/setup.bash\n\
exec rmf_api_server "$@"\n\
rmf_api_server "$@"\n\
' > /docker-entry-point.sh && chmod +x /docker-entry-point.sh
ENTRYPOINT ["/docker-entry-point.sh"]
1 change: 0 additions & 1 deletion example-deployment/docker/rmf-server.build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ FROM rmf-web/builder:$BUILDER_TAG

COPY . /root/rmf-web
RUN cd /root/rmf-web && \
lerna run prepare --include-dependencies --scope=api-server && \
cd packages/api-server && \
npm run prepack
19 changes: 19 additions & 0 deletions example-deployment/k8s/base/rmf-server/rmf-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ spec:
ports:
- protocol: TCP
port: 8000

---
apiVersion: v1
kind: Service
metadata:
name: rmf-server-ws
labels:
app: rmf-server-ws
tier: app
spec:
selector:
app: rmf-server
tier: app
ports:
- protocol: TCP
port: 8001

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -107,6 +124,8 @@ spec:
env:
- name: RMF_API_SERVER_CONFIG
value: /rmf-server-config/rmf_server_config.py
- name: RMW_IMPLEMENTATION
value: rmw_fastrtps_cpp
volumeMounts:
- mountPath: /rmf-server-config
name: rmf-server-config
Expand Down
2 changes: 1 addition & 1 deletion example-deployment/k8s/example-full/rmf_server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

config = deepcopy(default_config)
config["host"] = "0.0.0.0"
config["port"] = 8000
config["base_port"] = 8000
config["db_url"] = "postgres://rmf-server:rmf-server@rmf-server-db/rmf-server"
config["public_url"] = "https://example.com/rmf/api/v1"
config["log_level"] = "INFO"
Expand Down
5 changes: 5 additions & 0 deletions example-deployment/kustomize-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
set -e

kubectl() {
.bin/minikube kubectl -- "$@"
}
export -f kubectl

kubectl kustomize "$1" | envsubst