Skip to content

Conversation

@cosmintanasa47
Copy link
Contributor

@cosmintanasa47 cosmintanasa47 commented May 11, 2025

I think it works. Tested the containers and worked on my computer. Disk usage seems to be too high. May need improvements. Don't know if this is enough to do the challenge/activity.

Prerequisite Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Updated relevant documentation (if needed).

Description of changes

Added a Dockerfile that creates the environment to build and run the executable.
Added a Makefile to handle the Dockerfile (build, run, etc.)
Added a Makefile that is uploaded to the container and builds the executable, checks for the existence of the executable and checks if the executable is operating on port 31346.

With rwslotmachine3_runtime-cnt container running, I tested the communication with the app using nc and this was the result:

nc 127.0.0.1 32000
==== www / rww ====

  1. Read (1/1)
  2. Write (1/1)
  3. Exit
    |>2
    Input slot index: 3
    Input new slot value: 3
    Slot[3]:= 0003
    ==== www / rww ====
  4. Read (unavailable)
  5. Write (unavailable)
  6. Exit
    |> 1
    ==== www / rww ====
  7. Read (unavailable)
  8. Write (unavailable)
  9. Exit
    |> 3

nc 127.0.0.1 32000
==== www / rww ====

  1. Read (1/1)
  2. Write (1/1)
  3. Exit
    |> 1
    Input slot index: 3
    Slot[3]: 0000
    ==== www / rww ====
  4. Read (unavailable)
  5. Write (unavailable)
  6. Exit
    |> 3

32000 - local port linked with container port 31346.

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

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

Create two properly worded commits. See instructions here:

  • One commit adds Dockerfile and corresponding Makefile.
  • One commit adds Makefile for solution.

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

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

Use present tense.

Use your full name in the commit messages, i.e. use Cosmin Tanasa <[email protected]> instead of cosmintanasa47 <[email protected]>

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

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

Add README.md detailing how to run / deploy the container. Nothing out of the ordinary. See sample README from here.

@cosmintanasa47 cosmintanasa47 force-pushed the 03-rw branch 2 times, most recently from cb76137 to f893418 Compare May 17, 2025 13:31
@cosmintanasa47 cosmintanasa47 requested a review from razvand May 17, 2025 13:51
@razvand
Copy link
Contributor

razvand commented May 17, 2025

@cosmintanasa47 , use athe 03-rwslotmachine: prefix for your commit messages. Make them look consistent. If you add Resolves #50, add it everywhere.

…ckerization

Add a multi-stage Dockerfile that builds the 32bit binary for
the rwslotmachine3.c file and runs the binary on port 31346.
Local port for build container is 32000 and the
runtime container uses port 32001.

Add a Makefile that handles the Dockerfile's build, run and stop.

It works on my computer. Disk usage seems to be too high.
May need improvements.

Resolves: open-education-hub#50

Signed-off-by: Cosmin Tanasa <[email protected]>
This Makefile is used inside the containers
to build the executable, check if the executable
exists and also to check if the executable
is running on port 31346.

Resolves: open-education-hub#50

Signed-off-by: Cosmin Tanasa <[email protected]>
README file so everyone knows how to use the containers.

Resolves: open-education-hub#50

Signed-off-by: Cosmin Tanasa <[email protected]>
Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Razvan Deaconescu [email protected]
Approved-by: Razvan Deaconescu [email protected]

@razvand razvand merged commit 261916e into open-education-hub:main May 17, 2025
1 of 3 checks passed
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 this pull request may close these issues.

2 participants