Skip to content
Snippets Groups Projects

Replace README.md

parent 44e313f5
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@ This project is designed to deploy a Flask application that utilizes the SciBERT
- [Requirements](#requirements)
- [Setup](#setup)
- [Usage](#usage)
- [CI/CD Pipeline](#cicd-pipeline)
- [License](#license)
## Project Structure
......@@ -86,89 +85,6 @@ You can find all required packages listed in `requirements.txt`.
By default, the Flask application runs on `http://127.0.0.1:8080`. Open this URL in your web browser to access the application.
## CI/CD Pipeline
The project includes a CI/CD pipeline configured in `.gitlab-ci.yml` to automate the build and deployment process. The pipeline has the following stages:
1. **Install:**
- Installs dependencies from `requirements.txt`.
2. **Test:**
- Runs tests using `pytest`.
3. **Build:**
- Converts the Jupyter notebook to a Python script.
- Ensures the conversion was successful.
4. **Deploy:**
- Deploys the Flask application.
- Ensures the application runs in the background.
### Pipeline Configuration
Here is a brief overview of the `.gitlab-ci.yml` configuration:
```yaml
stages:
- install
- test
- build
- deploy
variables:
VIRTUAL_ENV: ".venv"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
before_script:
- python3 -m venv $VIRTUAL_ENV
- source $VIRTUAL_ENV/bin/activate
- pip install -r requirements.txt
install:
stage: install
script:
- echo "Installing dependencies..."
- pip install -r requirements.txt
artifacts:
paths:
- $VIRTUAL_ENV
test:
stage: test
script:
- echo "Running tests..."
- pytest tests/
artifacts:
when: always
reports:
junit: junit.xml
build:
stage: build
script:
- echo "Building the project..."
- jupyter nbconvert --to script app.ipynb
- if [ ! -f app.py ]; then echo "Conversion failed, exiting pipeline"; exit 1; fi
- echo "Build completed successfully."
artifacts:
paths:
- app.py
deploy:
stage: deploy
script:
- echo "Deploying the application..."
- nohup python3 app.py &
- sleep 5
- echo "Application should have started in the background."
only:
- main
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment