Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migration of playground configuration and broken examples fixed #58

Merged
merged 11 commits into from
Jul 21, 2023

Conversation

axmmisaka
Copy link
Collaborator

@axmmisaka axmmisaka commented Jul 13, 2023

Fixes #53.

Things done:

  • Copy all the files from the lingua-franca-playground repository
  • Configure CI in this repository to use setup-env.bash
  • Handle ROS2 installation in setup-env.bash
  • Handle Crow installation in setup-env.bash
  • Move examples into examples directory
  • Add libwebsockets installation
  • Add support for MQTT
  • Fix ./C/src/browser-ui/WebSocket.lf
  • Fix ./CCpp/src/DoorLock/DoorLock.lf
  • Fix./C/src/mqtt/* requires libpaho-mqtt-dev
  • Fix ./C/src/simulation/MemoryHierarchy.lf needed to include platform.h
  • Fix ./examples/Cpp/ROS2/src/MinimalPublisher.lf
  • Fix ./examples/Cpp/ROS2/src/MinimalSubscriber.lf
  • Fix ./examples/C/src/train-door/TrainDoor.lf
  • Fix ./examples/CCpp/src/ROS/ROSSerialization.lf
  • Fix ./examples/C/src/rhythm/RhythmDistributedNoUI.lf (If clock sync is on, link math reactor-c#252)
  • Move Piano to experiments
  • Move ROS/MigrationGuide to experiments

axmmisaka and others added 2 commits July 13, 2023 01:27
@lhstrh lhstrh changed the title Merge lf-playground with adaptations Migration of playground configuration Jul 13, 2023
@lhstrh
Copy link
Member

lhstrh commented Jul 13, 2023

Would we be able to put together a docker config based on this for standalone desktop use as well? For the EECS149 class in the fall, it would be great to have this. Specifically, there are a bunch of Windows machines in the lab that are expected to run an Ubuntu VM. Maintenance of the VM image we've used has been painful and clunky...

@lhstrh lhstrh force-pushed the merge-playground-container branch 2 times, most recently from 7902d0f to edaeb14 Compare July 13, 2023 20:20
@lhstrh
Copy link
Member

lhstrh commented Jul 14, 2023

Looks like we could try using https://github.com/iximiuz/docker-to-linux or https://github.com/linka-cloud/d2vm for VM creation...

Docker Desktop is capable of running Docker containers, but AFAIK not with a graphical shell.

@axmmisaka
Copy link
Collaborator Author

Looks like we could try using https://github.com/iximiuz/docker-to-linux or https://github.com/linka-cloud/d2vm for VM creation...

Docker Desktop is capable of running Docker containers, but AFAIK not with a graphical shell.

I think maybe running the scripts or simply let people run docker would suffice? I think with our current settings, the docker->vm route will bring us headache......
That is because, as the article suggested, docker relies on OS virtualisation, and building VM from a docker image requires pulling, additionally, bootloader and other stuff...... In contrast, we could just base off ubuntu/debian's base image

@lhstrh
Copy link
Member

lhstrh commented Jul 15, 2023

OK, let's forget about the VM for the time being and focus on getting the dependencies installed (see todo's above).

@axmmisaka
Copy link
Collaborator Author

OK, let's forget about the VM for the time being and focus on getting the dependencies installed (see todo's above).

👍

@axmmisaka
Copy link
Collaborator Author

ROS2 took me a while, but then I realised maybe using distribution port (which is typically older) could also work with LF...... They won't be installed in /opt/ros, but might be fine depending on how LF uses them.

22.04 Outdated Show resolved Hide resolved
@lhstrh lhstrh mentioned this pull request Jul 20, 2023
utils/scripts/setup-env.bash Outdated Show resolved Hide resolved
utils/scripts/setup-env.bash Show resolved Hide resolved
utils/scripts/setup-env.bash Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@lhstrh lhstrh mentioned this pull request Jul 20, 2023
@lhstrh lhstrh force-pushed the merge-playground-container branch from 324eca4 to fdb2172 Compare July 20, 2023 22:00
@lhstrh lhstrh changed the title Migration of playground configuration Migration of playground configuration and broken examples fixed Jul 20, 2023
@axmmisaka
Copy link
Collaborator Author

For ./examples/CCpp/src/ROS/MigrationGuide/lf-project, the issue now is that it requires external libraries to be built before running LF (as outlined in https://github.com/axmmisaka/examples-lingua-franca/tree/0c4817da8c87400481d7129c54d7524fcfa580bc/CCpp/src/ROS/MigrationGuide); the error message will be different after running colcon build and source install.bash.

I recommend moving this file to experiments, although this sounds a bit like cutting one's head off to cure headache 🤣

@lhstrh
Copy link
Member

lhstrh commented Jul 21, 2023

For ./examples/CCpp/src/ROS/MigrationGuide/lf-project, the issue now is that it requires external libraries to be built before running LF (as outlined in https://github.com/axmmisaka/examples-lingua-franca/tree/0c4817da8c87400481d7129c54d7524fcfa580bc/CCpp/src/ROS/MigrationGuide); the error message will be different after running colcon build and source install.bash.

I recommend moving this file to experiments, although this sounds a bit like cutting one's head off to cure headache 🤣

I think that classifying this as an experiment is accurate. We can always move it back.

@axmmisaka axmmisaka force-pushed the merge-playground-container branch from 80ee05e to 5167e0e Compare July 21, 2023 01:02
@lhstrh lhstrh force-pushed the merge-playground-container branch from f9823f6 to 5167e0e Compare July 21, 2023 03:34
@lhstrh lhstrh requested a review from cmnrd July 21, 2023 05:07
@lhstrh
Copy link
Member

lhstrh commented Jul 21, 2023

At this time, only one example fails to compile. CI will pass once lf-lang/lingua-franca#1907 has been merged.

@lhstrh lhstrh mentioned this pull request Jul 21, 2023
lhstrh and others added 6 commits July 21, 2023 07:05
- Install cargo
- Setup Crow
- A comprehensive ROS2 setup that supports both distro port and
  official. (I'm unsure if LF will support the distro port) and lets
  user to choose which one they want
- Added ROS2, libwebsockets-dev and mosquitto MQTT
- Added switch to enable/disable installiation of ROS2 and
  network-related dependencies
- Install libpaho-mqtt-dev
- Setup bashrc so bash consoles can use it
- Build libwebsocket from source so CMake does not complain

Co-authored-by: Marten Lohstroh <marten@berkeley.edu>
This commit:
Moves non-experimental examples into a directory named "examples"
Moves experimental examples into "experiments"
Move Piano to "experiments" because it requires a lot of random dependencies
Move migration guide to `experiments`
Fixed:
- Traindoor.lf
- MemoryHierachy.lf
- Doorlock.lf
- ROSSerialization.lf

Co-authored-by: Peter Donovan <peterdonovan@berkeley.edu>
Copy link
Contributor

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @axmmisaka! This looks like a great effort!

@cmnrd cmnrd merged commit ebcf898 into lf-lang:main Jul 21, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
3 participants