-
Rosanny Sihombing authoredcf5f8161
Step-by-Step Installation Guide
Prerequisite: Access to Repos and Documentation
Ensure you have read access to the following repositories:
- Frontend: Frontend GitLab Repo
- Backend: Backend GitLab Repo
- Test Runner: Test Runner GitLab Repo
Prerequisite: Infra Downloads (VirtualBox & Ubuntu 22.04 LTS Desktop)
Download and install the following:
Host Installation
- Install VirtualBox.
- [Optional] Install VirtualBox Guest Additions for better integration.
Virtual Machine (VM) Installation
-
Create a new VM in VirtualBox with the following settings:
- CPU: 2 CPUs x 1 Core
- RAM: 4 GB
- HDD: 40 GB
- Network: Default settings
- ISO Image: Use the downloaded Ubuntu 22.04 LTS Desktop ISO
-
Start the VM and proceed with the installation:
- Choose
Install Ubuntu
. - Select
Minimal Installation
. - Accept default settings.
- Create a user (use your initials or a username of choice).
- Choose
Inside Ubuntu 22.04 LTS Desktop (Minimal Installation Setup)
-
Update the package list:
sudo apt update
-
Install required packages:
sudo apt install git openjdk-17-jdk maven docker.io docker-compose
-
Download and install Eclipse IDE:
- Download: Eclipse IDE for Java EE Developers
- Create an Eclipse directory:
sudo mkdir /opt/eclipse sudo chown root:docker /opt/eclipse
- Unpack the downloaded file:
sudo tar xvzf ~/Downloads/eclipse-jee-2023-12-R-linux-gtk-x86_64.tar.gz -C /opt/eclipse
- Create a symbolic link for Eclipse:
sudo ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse
Loading Assets
-
Create a development directory and clone the repositories:
mkdir ~/dev cd ~/dev git clone <repository_url>
-
Start Eclipse:
- Create a new workspace under
~/dev
. - Ensure
.gitignore
includes Eclipse project files.
- Create a new workspace under
-
Import the Maven projects from the file system into Eclipse.
-
If necessary, create a local Maven repository by following the documentation in the backend repository.
-
Add a dependency for
unifiedticketing
:mvn deploy:deploy-file -DgroupId=de.hftstuttgart -DartifactId=unified-ticketing -Dversion=0.2.2 -Durl=file:./local-maven-repo/ -DrepositoryId=local-maven-repo -DupdateReleaseInfo=true -Dfile=./local-maven-repo/unified-ticketing-0.2.2.jar
Docker Setup
-
Create and configure a Docker Compose environment:
- Copy the
docker-compose.yaml
file from the repository. - Spin up the services using:
docker-compose up -d
- Copy the
-
After starting Moodle:
- Install the DTA plugin.
- Configure Moodle to open the necessary ports and hosts:
- Site Administration > Security > HTTP Security.
- Set the DTA plugin backend URL to the Docker service name (e.g.,
cahcedta:8080
).
-
Ensure read/write access to the host temp directory for the DTA plugin:
sudo chown root:docker /tmp/dta-tests
-
Configure Moodle:
- Create a new course.
- Add a new assignment.
- Set the assignment as Dockerized Test Agent.
- Provide the example repo in
teacher-dta-dir.txt
.
-
Add a submission and provide the example repo in
student-dir.txt
.
Pushing Results
-
Create accounts:
- GitLab Account (HFT Transfer)
- DockerHub Account
-
Add your accounts to the necessary groups in GitLab.
-
Create a Gitlab Access Token To authenticate with GitLab, you will need to create a Personal Access Token. Follow these steps:
- Log in to your GitLab account.
- Navigate to the User Settings by clicking on your profile icon in the top-right corner.
- Under Access Tokens, create a new token:
-
Name: Choose a descriptive name (e.g.,
GitLab Access Token
). -
Scopes: Select the appropriate scopes. For typical git operations, you will need:
api
read_repository
write_repository
- Expiration Date: Set an expiration date (optional but recommended).
-
Name: Choose a descriptive name (e.g.,
- Click Create Access Token and save it securely. This is the only time the token will be shown.
-
Configure Git to Use the Access Token Now that you have the access token, configure git to use it for authentication. Open a terminal and follow these steps:
-
Cache Git Credentials (to avoid entering the token multiple times):
git config --global credential.helper cache
This will cache your credentials for a short period of time.
-
Set your Git Username:
git config --global user.name "<your_name>"
Replace
<your_name>
with your GitLab username.- Set your Git Email:
git config --global user.email "<your_email>"
Replace
<your_email>
with the email associated with your GitLab account.- Verify the Git Configuration: To check the configuration settings you just applied, use:
git config -l
This command will list all the global configurations for git.
-
-
Use the Access Token for Git Operations: When you perform a git operation (such as
git clone
,git pull
, orgit push
) that requires authentication, Git will prompt you for a username and password. Use the following:- Username: Your GitLab username or email.
- Password: Paste the Personal Access Token you created earlier.
Git will then authenticate using the access token.
-
Push your results:
- Always pull before pushing:
git pull
- In case of conflicts:
git merge
- Push your changes:
git push
- Push the Docker image:
docker push <image>
- Always pull before pushing:
Running the Application
-
Create a directory for the modta:
mkdir ~/modta cp -R ~/dev/dtabackend/ifc/generic-proxy/ ~/modta
-
Set up the environment:
sudo mkdir /tmp/dta-tests sudo chown root:docker /tmp/dta-tests export EGID=$(getent group docker | cut -d: -f3) cd ~/modta docker-compose up -d
-
Check if the containers are running successfully:
docker container ls
Application Setup
-
Moodle Installation:
- Follow the Moodle documentation in the frontend repository: Moodle DTA Docs.
-
Testing:
- See the testing documentation in the backend repository: Backend Test Docs.
-
View Logs:
docker logs -f <container_name>
-
Stop Services:
docker-compose down