You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-8Lines changed: 47 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,48 @@
1
1
# Dockerized-CAEN
2
2
3
-
This is a Docker container running the same debugging software on UofM CAEN servers, which can integrate into your Makefile for automatic testing on your local machine. As of 23 January 2022, the compiler version is 8.50 20210514, so there could be some minor inconsistancies between this container and the actual CAEN servers.
3
+
[](https://github.com/derickson2402/Dockerized-CAEN/actions/workflows/publish.yml)[](https://github.com/derickson2402/Dockerized-CAEN/actions/workflows/testing.yml)
4
4
5
-
To use this container, you need to have Docker installed on your [macOS](https://docs.docker.com/desktop/mac/install/), [Windows](https://docs.docker.com/desktop/windows/install/), or [Linux](https://docs.docker.com/engine/install/) computer.
6
-
7
-
With Docker installed and running, simply put the ```caen``` script in your project folder and preface any of your commands with it, like such:
5
+
Tired of using ssh and Duo mobile when testing your code with CAEN? With this script, all you have to do is run:
8
6
9
7
```bash
10
8
./caen <program> [args]
11
9
```
12
10
13
-
Note that the executables generated with ```./caen make``` will not be executable by your host machine, so run ```make clean``` before switching environments.
11
+
This will run your command in an environment identical to CAEN Linux. For example, if you are working on a c++ project for EECS 281, you could use:
12
+
13
+
```bash
14
+
./caen make clean
15
+
./caen make my_program.cpp
16
+
./caen valgrind my_program.cpp
17
+
./caen perf my_program.cpp
18
+
```
19
+
20
+
## Installation
21
+
22
+
To use this script, you need to have Docker installed on your [macOS](https://docs.docker.com/desktop/mac/install/), [Windows](https://docs.docker.com/desktop/windows/install/), or [Linux](https://docs.docker.com/engine/install/) computer. With Docker installed and running, simply the ```caen``` script in your project folder and preface any of your commands with it. Run the following in your project folder to automatically grab the script:
This script runs your command inside of a Docker Container, which is like a virtual environment running Linux. This environment is set up with CentOS (a fork of the RHEL on CAEN) and all of the tools that you normally use on CAEN. That means that there should be no difference running a program in the container versus on actual CAEN servers, and that the Autograder compiler should work the same as in the container!
31
+
32
+
## Help! I Need A Program That's Not Installed!
33
+
34
+
Oops! Sorry about that! Please log an issue [here](https://github.com/derickson2402/Dockerized-CAEN/issues/new) with the name of said program and any special tools that might go along with it. I will add it as soon as I can! For a temporary workaround, see the section below on [hackery](#hackery).
35
+
36
+
## Useful Tips
14
37
15
38
This container is currently under development, but the script does not check for updates automatically. To get the newest container version, run the following in a terminal with Docker running:
Executables generated with this container are compiled for CAEN servers and won't work on your host system. You should run your ```make clean``` script before switching back and forth, and then run ```make``` from the environment you want to use.
45
+
21
46
You can also integrate CAEN with your ```Makefile``` so that when you call ```make [job]``` it automatically runs in the container. Do this by replacing the ```CXX``` variable with the following:
22
47
23
48
```Makefile
@@ -27,12 +52,26 @@ CXX = ./caen g++
27
52
If you do not want to download the ```caen``` script, you can also just preface your commands with the following, but this is not recommended:
28
53
29
54
```bash
30
-
docker run --rm -it --pull -v "$(pwd):/code" ghcr.io/derickson2402/dockerized-caen:latest <valgrind|perf><program> [args]
55
+
docker run --rm -it -v "$(pwd):/code" ghcr.io/derickson2402/dockerized-caen:latest <valgrind|perf><program> [args]
56
+
```
57
+
58
+
## Hackery
59
+
60
+
If the container environment is not suiting your needs, you can always run the container manually and hack it into working. The problem is that the update won't survive a container restart, so change the normal script like so:
61
+
62
+
```bash
63
+
docker run -it --name caen-tainer -v "$(pwd):/code" ghcr.io/derickson2402/dockerized-caen:latest bash
64
+
```
65
+
66
+
The important part is to get rid of the ```--rm``` tag so the container isn't destroyed when it exits, and to give it a name to easily reference it with (you don't have to use ```caen-tainer```, but I thought it was funny :smile:). You should be able to jump back into the container with either of:
67
+
68
+
```bash
69
+
docker start -ai caen-tainer
70
+
docker exec -it caen-tainer <command>
31
71
```
32
72
33
-
# Contributing
73
+
##Contributing
34
74
35
75
I started working on this project while taking EECS-281, in order to make debugging my programs easier. I am sharing this project online in hopes that others will find it useful, but note that I don't have much free time to develop this project.
36
76
37
77
With that said, if you have an idea that would make this project even better, feel free to log an issue or submit a Pull Request. I greatly appreciate any help on developing this project!
0 commit comments