Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Wrong docker image name and ADA.ASSERTIONS.ASSERTION_ERROR in Example Project #2

Closed
krouziciorel opened this issue Nov 26, 2023 · 6 comments · Fixed by #3
Closed

Wrong docker image name and ADA.ASSERTIONS.ASSERTION_ERROR in Example Project #2

krouziciorel opened this issue Nov 26, 2023 · 6 comments · Fixed by #3
Assignees

Comments

@krouziciorel
Copy link

krouziciorel commented Nov 26, 2023

Thank you very much for publishing the Adamant framework. I tried to run the example and so far I found two errors:

  1. DOCKER_IMAGE_NAME in docker_config.sh should be "dinkelk/adamant:example-latest"

  2. In the Running the Example Project section, I am doing the following:

$ ./login_container.sh
user@1234$ cd ~/example/src/assembly/linux/main
user@1234$ redo run

but I get an error message before running:

redo ../../../../adamant/src/types/command/build/obj/Linux/command_header-representation.o
redo ../../../../adamant/src/types/packet/build/obj/Linux/packet_id-representation.o

Unhandled exception occurred in main: raised ADA.ASSERTIONS.ASSERTION_ERROR : Unhandled exception occurred while connecting to socket in main_task_0000000000E45ED0

Can you please check this Docker image (I use Arch linux with last Docker docker 1:24.0.7-1 package)?

@dinkelk
Copy link
Collaborator

dinkelk commented Nov 26, 2023

Thank you for taking a look at the project and for finding these errors. We are transferring the docker image management from dockerhub to github, so the correct image is now ghcr.io/lasp/adamant:example-latest. I have made this change in docker_config.sh and pushed it to the issue branch.

I cannot reproduce the assertion, but I am looking into possible causes now.

@dinkelk
Copy link
Collaborator

dinkelk commented Nov 26, 2023

I added a better error message to the socket package throwing that exception, see: lasp/adamant#3. Try pulling from main in the adamant repository and running again.

@dinkelk dinkelk linked a pull request Nov 26, 2023 that will close this issue
@dinkelk dinkelk reopened this Nov 27, 2023
@krouziciorel
Copy link
Author

Thanks for the quick reply, I imported a new docker container and tried the same commands as last time.

I am currently seeing this error message:

redo ../../../../../adamant/src/types/packet/build/obj/Linux/packet_id-representation.o
Starting Linux demo... Use Ctrl+C to exit.
0000009134.604751155 - Ccsds_Socket_Interface_Instance.Socket_Not_Connected (0x00000086) : (Ip_Address = [00 00 00 00], Port = 0)
0000009134.605247755 - Counter_Instance.Sending_Value (0x00000091) : (Value = 1)
0000009136.605136998 - Counter_Instance.Sending_Value (0x00000091) : (Value = 2)
0000009138.605067704 - Counter_Instance.Sending_Value (0x00000091) : (Value = 3)
0000009140.605041641 - Counter_Instance.Sending_Value (0x00000091) : (Value = 4)
0000009142.605163901 - Counter_Instance.Sending_Value (0x00000091) : (Value = 5)
0000009144.605276301 - Counter_Instance.Sending_Value (0x00000091) : (Value = 6)
0000009146.605240088 - Counter_Instance.Sending_Value (0x00000091) : (Value = 7)
0000009148.605198489 - Counter_Instance.Sending_Value (0x00000091) : (Value = 8)
0000009150.605228336 - Counter_Instance.Sending_Value (0x00000091) : (Value = 9)
0000009152.605136751 - Counter_Instance.Sending_Value (0x00000091) : (Value = 10)

...

0000010094.605184010 - Counter_Instance.Sending_Value (0x00000091) : (Value = 481)
^CTraceback (most recent call last):
File "/home/user/example/default.do", line 84, in
rule.build(*sys.argv[1:])
File "/home/user/adamant/redo/base_classes/build_rule_base.py", line 60, in build
to_return = self._build(redo_1, redo_2, redo_3)
File "/home/user/adamant/redo/rules/build_run.py", line 38, in _build
shell.run_command(binary + " >&2")
File "/home/user/adamant/redo/util/shell.py", line 44, in run_command
status = try_run_command(command_string, debug)
File "/home/user/adamant/redo/util/shell.py", line 17, in try_run_command
process.communicate()
File "/usr/lib/python3.7/subprocess.py", line 956, in communicate
self.wait()
File "/usr/lib/python3.7/subprocess.py", line 1019, in wait
return self._wait(timeout=timeout)
File "/usr/lib/python3.7/subprocess.py", line 1669, in _wait
(pid, sts) = self._try_wait(0)
File "/usr/lib/python3.7/subprocess.py", line 1627, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Error: Redo script '/home/user/example/default.do' failed to build '/home/user/example/src/assembly/linux/main/run' with exit code: -2

I have little programming experience (but I am very interested in Ada and the professional Adamant framework), so I can't help with solutions, but at least I can report bugs.

@dinkelk
Copy link
Collaborator

dinkelk commented Nov 27, 2023

Thank you for your interest and for reporting issues that you find.

What you report is the expected behavior. The example is running correctly until you run CTRL+C.

However, this is a bit unexpected:

0000009134.604751155 - Ccsds_Socket_Interface_Instance.Socket_Not_Connected (0x00000086) : (Ip_Address = [00 00 00 00], Port = 0)

The example assembly tries to connect to a socket at address host.docker.internal and port 2003. It looks like this is not being resolved correctly in your linux-based docker, since those values are being forced to zero. From what I can see, this is supposed to be working in the latest docker version. See: https://stackoverflow.com/questions/48546124/what-is-linux-equivalent-of-host-docker-internal

You won't run into trouble unless you try to send commands or capture telemetry through that socket. You could try changing the address to 172.17.0.1 for the Ccsds_Socket_Interface in linux_example.assembly.yaml (or other solutions mentioned in that stack overflow thread) if you need to use the socket.

@dinkelk dinkelk closed this as completed Nov 27, 2023
@krouziciorel
Copy link
Author

Thanks for the heads up, the ideal solution for linux at the moment is to use docker-host:

https://github.com/qoomon/docker-host

Now the example is fully functional.

@dinkelk
Copy link
Collaborator

dinkelk commented Nov 28, 2023

Curious. I am wondering if you can add the following --add-host=host.docker.internal:host-gateway to the create_container.sh script (ie. docker run call). This might allow it to work without the docker-host sidecar.

This is suggested in the accepted answer here: https://stackoverflow.com/questions/48546124/what-is-linux-equivalent-of-host-docker-internal

If that works, it might be a good idea to add that run flag to create_container.sh for all linux hosts.

Jbsco referenced this issue in Jbsco/adamant_example Nov 28, 2023
Relating to comments in issue #2, added case for `linux-gnu` OSTYPE to implement the internal host when creating the docker container on this platform.
Jbsco added a commit to Jbsco/adamant_example that referenced this issue Nov 28, 2023
Relating to comments in issue lasp#2, added case for `linux-gnu` OSTYPE to implement the internal host when creating the docker container on this platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants