Report 4. Testing, CI/CD & Deployment Setup #
UrTraining #
Authors: Ildar Rakiev, Makar Dyachenko, Salavat Faizullin, Egor Chernobrovkin, Alexandra Starikova, Ilona Dziurava, Anisya Kochetkova
Date: July 2025
Team Members #
Team Member | Telegram | Email Address | Role |
---|---|---|---|
Ildar Rakiev (Lead) | @mescudiway | i.rakiev@innopolis.university | Backend / Frontend |
Makar Dyachenko | @index099 | m.dyachenko@innopolis.university | Frontend / Design |
Salavat Faizullin | @FSA_2005 | s.faizullin@innopolis.university | Backend |
Egor Chernobrovkin | @lolyhop | e.chernobrovkin@innopolis.university | ML |
Alexandra Starikova | @lexandrinnn_t | a.nasibullina@innopolis.university | ML |
Ilona Dziurava | @a_b_r_i_c_o_s | il.dziurava@innopolis.university | PM |
Anisya Kochetkova | @anis1305 | a.kochetkova@innopolis.university | Testing |
Implemented features #
Visualization:
The user flow diagram can be seen below, the non-implemented features are highlighted in red:
Implemented Features: #
1. Advanced trainer registration #
2. Editing of trainer registration #
3. Training Uploading #
Training uploading:
Training uploading (success case)
4. AI assistants #
- An AI Assistant that pops up in the window when choosing courses.
Commits: AI Assistant implementation
- An AI Assistant that pops up in the window after clicking on the course. The main difference between this assistant is that it has a complete description of the program that the user is watching.
Commits: AI Assistant implementation
CI/CD Pipeline Documentation #
1. Pipeline Overview #
Deployment Targets #
Service | Path | Technology | Deployment Method |
---|---|---|---|
Backend | backend/ | Docker | SSH + Docker Compose |
Frontend | frontend/ | Vite + Nginx | SSH + File Copy |
Image2Tracker | ml/image2tracker/ | Docker | SSH + Docker Compose |
Vector DB | ml/vector-db/ | Docker | SSH + Docker Compose |
2. Workflow Configuration #
Common Structure #
All workflows share the same trigger pattern: pull request with main
branch or push to this branch.
on:
push:
branches: [ "main" ]
paths: [ "service_path/**" ]
pull_request:
types: [closed]
branches: [ "main" ]
paths: [ "service_path/**" ]
Key Components #
Conditional Execution:
if: | github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged)
SSH Deployment:
uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.SSH_HOST }} username: ${{ secrets.SSH_USER }} key: ${{ secrets.SSH_KEY }}
Hereβs a polished version of the third section with clear technical explanations:
3. Deployment Processes #
For Backend and ML Services (Dockerized) #
Each Docker-based service follows this robust deployment sequence:
Code Synchronization
The pipeline first pulls the latestmain
branch to ensure the server has all recent commits:cd ~/UrTraining git pull origin main
Container Management
Using Docker Compose for deterministic deployments:cd service_directory docker-compose down # Graceful shutdown docker-compose build --no-cache # Clean rebuild docker-compose up -d # Daemonized startup
Key notes:
--no-cache
prevents cached layers from causing inconsistencies-d
flag runs containers in detached mode
Atomic Deployment
The entire process is wrapped in aflock
mutex lock to prevent concurrent deployments:flock /tmp/service-deploy.lock -c '...'
For Frontend (Static Assets) #
The frontend deployment takes a different approach:
Build Process
Creates production-optimized assets:npm install # Ensures fresh dependencies npm run build # Generates /dist directory
Atomic File Replacement
Safely updates live assets without downtime:sudo rm -rf /var/www/myfrontend/* # Clean deploy sudo cp -r dist/* /var/www/myfrontend # Atomic copy sudo systemctl restart nginx # Graceful reload
Critical Design Aspects:
- All file operations use
sudo
to ensure proper permissions - Nginx restart is instantaneous to end-users
- The entire process is logged for audit purposes
4. Critical Features #
Deployment Safety Mechanisms #
- File Locking:
flock /tmp/service-deploy.lock -c '...'
- Logging:
LOG_FILE=~/deploy-service.log { # Deployment commands } >> $LOG_FILE 2>&1
Error Handling #
set -e
in scripts fails on first error- All Docker commands run in sequence with error checking
5. Environment Details #
Server Requirements #
- Docker + Docker Compose installed
- Nginx for frontend
- SSH access configured
- Directory structure:
~/UrTraining/ βββ backend/ βββ frontend/ βββ ml/ β βββ image2tracker/ β βββ vector-db/
6. Troubleshooting #
Common Issues #
- SSH Connection Failures:
ssh -v $SSH_USER@$SSH_HOST
- Docker Build Errors:
docker system prune -a docker-compose build --no-cache
Log Locations #
~/deploy-backend.log
~/deploy-vector-db.log
~/deploy-image2tracker.log
/var/log/nginx/error.log
Problems and solutions: #
Problem | Our solution |
---|---|
Ports conflicts when deploying | Unique ports are assigned (backend: 8000 , vector-db: 1337 ). |
Long dependency installation | Added caching for npm and pip . |
Problems with synchronization of deployment on the server from different pipelines | Special flock blocks were added to avoid problems with simultaneous deployment |
Errors during SSH deployment | A separate SSH user with limited rights is configured. |
Errors during frontend deployment (dist directory cannot be copied to server correctly) | Local building to avoid copying errors (temporary solution) |
7. Maintenance #
Secret Rotation #
- Updated information GitHub Secrets, especially Actions secrets:
SSH_HOST
SSH_USER
SSH_KEY
Update Procedure #
- Modify workflow files in
.github/workflows/
- Test via PR to non-main branch (trigger PRs)
- Merge to main for production deployment
CI/CD logs #
Deploy #
Fronted part is deployed HERE.
Backend part is deployed HERE.
ML part is deployed HERE.
Testing #
Unit tests for critical backend logic #
These are unit tests that check the correctness of the database models in our application. General principles of testing:
- Checking the creation of records (whether they are saved correctly in the database)
- Checking the relationships between models (for example, the user_id in the Training Profile)
- Checking default values (for example, is_active=True)
- Checking data types (numbers, strings, lists)
Commit: Unit tests
Integration tests for API endpoints #
API tests check all sorts of things with the API, mainly for the correct nature of the entered data, for example, that the user can register, log in, and delete the user from the database
Commit: API endpoints tests
Basic end-to-end tests for the core user journey #
Tests covering the trainee journey
- Authentication Flow
- Minimum/maximum values, Optional fields, Long text inputs, Empty fields, Country/city validation
- Survey data
- Profile setup
- View workout details
Commit: End-to-end tests
Vibe check #
During the team health check meeting, we aimed to assess our collaboration, communication, and overall team well-being. The discussion revealed several areas for improvement, especially from the online team members. One major concern was the lack of coordination meaning that team members often worked in isolation and contacted only the team lead in case of any problems. There was a shared opinion that the development process lacked transparency, with some features being implemented without others being aware. Team members suggested introducing short update sessions to keep everyone informed and aligned. Another key point was the inconsistency in how pull requests were handled. Some were submitted without titles or descriptions, making it hard for others to review or understand the context. It was agreed that improving PR practices and testing each otherβs work would strengthen team dynamics, ensure better code quality, and help everyone feel more included. This health check provided a valuable space for honest feedback and reinforced our commitment to working as a more cohesive and communicative team.
Weekly Progress Report #
Team Member (Role) | Contribution Description | Contribution Link |
---|---|---|
Ildar Rakiev (Backend/Frontend Lead) | Led backend and frontend development of key features including CI/CD pipeline setup, advanced trainer registration with integrated survey, and a training course editor interface. | Advanced registration for trainer with servey, Training course editor, CI/CD pipelines |
Makar Dyachenko (Frontend/Design) | Developed and styled user interface components including navigation and metadata pages. | Navbar basic routing, Metadata page |
Salavat Faizullin (Backend) | Worked on data validation and backend integrity by adding constraints for city and country fields and fixing issues related to training ID management in the system. | City and country values validation add, Fix trainings ids |
Egor Chernobrovkin (ML) | Designed and implemented the AI Assistant for course selection. Developed backend services for BM25 indexing, session tracking, prompt engineering, and user query formatting to support a responsive assistant experience. | Add MVP for image2tracker, Simplify dockerfile, Add BM25 indexing, Choose course assistant chat endpoint, Request/response models for choose course assistant API, Choose course assistant system prompt, Chat service with session tracking, Prompt formatting utility for user inputs |
Alexandra Starikova (ML) | Contributed to data parsing and management by developing a sketch tool for extracting course data from images, implementing mechanisms for dynamic course data updates, and preparing reference files for bulk data uploads. | A sketch for parsing programs from images, Interactive updates of course data, Reference files for uploading data |
Ilona Dziurava (PM) | Prepared the project report, facilitated two team meetings, coordinated task distribution, maintained the product backlog, organized and led a retrospective, and structured the teamβs workflow for efficient collaboration | This report :) |
Anisya Kochetkova (Testing) | Implemented testing strategies, including unit, API, and end-to-end tests. Created the AI assistant for the specific course. | Unit tests, API endpoints tests, End-to-end tests, Course assistant chat endpoint, Request/response models for course assistant API, Course assistant system prompt, Chat service with session tracking, Prompt formatting utility for user inputs |
Challenges & Solutions #
The most challenging part of this week was setting up the CI/CD pipeline, as none of the team members had prior experience with it. To overcome this, three team members collaborated closely, sharing research, troubleshooting together, and verifying each step of the setup process. This teamwork ensured the pipeline was configured correctly and became a valuable learning experience for everyone involved.
Conclusions & Next Steps #
By the end of Week 4, we had a stable, tested, and deployed version of our application in a staging environment, complete with CI/CD automation. This allows for updates and reliable testing going forward. Additionally, the trainer user flow was successfully implemented.
Next Steps for Week 5 #
Implement profile pages
- Implement personal profile pages for user ans trainer.
- Add functionality for profile editing.
Feedback Collection:
- Share the staging app with external testers.
- Collect structured feedback through forms.
Feedback Analysis:
- Document feedback and create actionable issues in the backlog.
- Prioritize bug fixes and usability improvements.
Iteration & Refinement:
- Address top-priority feedback, focusing on UI/UX and error handling.
- Improve frontend responsiveness and backend robustness.
- Polish documentation (README, API reference).
ML Enhancements:
- Refine model predictions based on validation outcomes.
- Explore metrics to evaluate prediction quality and fairness.
Week 5 will focus on improving the product based on the the user experience, resolving known bugs, and improving the overall quality and stability of the product in preparation for final presentation and submission.
We confirm that the code in the main branch:
In working condition. Run via docker-compose.