Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NLPPIPELINE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hafiz, Aqib (PG/T - Comp Sci & Elec Eng)
NLPPIPELINE
Commits
c7a3ae13
Commit
c7a3ae13
authored
1 year ago
by
Hafiz, Aqib (PG/T - Comp Sci & Elec Eng)
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
450121af
No related branches found
No related tags found
No related merge requests found
Pipeline
#72626
failed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+37
-20
37 additions, 20 deletions
.gitlab-ci.yml
with
37 additions
and
20 deletions
.gitlab-ci.yml
+
37
−
20
View file @
c7a3ae13
stages
:
# List of stages for jobs, and their order of execution
stages
:
-
build
-
train
-
test
-
test
-
deploy
-
deploy
build-job
:
# This job runs in the build stage, which runs first.
variables
:
stage
:
build
MODEL_PATH
:
"
distilbert-finetuned-ner"
script
:
-
echo "Compiling the code..."
before_script
:
-
echo "Compile complete."
# Ensure the required Python version and pip are set up
-
apt-get update && apt-get install -y python3 python3-pip
-
python3 -m pip install --upgrade pip
-
pip3 install -r requirements.txt
unit-test-job
:
# This job runs in the test stage.
train
:
stage
:
t
est
# It only starts when the job in the build stage completes successfully.
stage
:
t
rain
script
:
script
:
-
echo "Running unit tests... This will take about 60 seconds."
-
python3 train_model.py
-
echo "Code coverage is 90%"
artifacts
:
paths
:
-
$MODEL_PATH
# Save the trained model as an artifact
lint-test-job
:
# This job also runs in the test stage.
test
:
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
stage
:
test
script
:
script
:
-
echo "Linting code... This will take about 10 seconds."
-
echo "Testing the model..."
-
echo "No lint issues found."
# Ensure Flask is installed
-
pip3 install flask
# Run the Flask app in the background
-
nohup python3 app.py &
-
sleep
10
# Wait for the server to start
# Run the tests
-
curl -X POST http://localhost:5003/predict -H "Content-Type
:
application/json" -d '{"tokens"
:
[
"
For"
,
"
this"
,
"
purpose"
,
"
the"
,
"
Gothenburg"
,
"
Young"
,
"
Persons"
,
"
Empowerment"
,
"
Scale"
,
"
("
,
"
GYPES"
,
"
)"
,
"
was"
,
"
developed"
,
"
."
]
}
'
-
curl
-X
POST
http://localhost:5003/stress_test
-H
"Content-Type:
application/json"
-d
'
{
"
tokens"
:
[
"
For"
,
"
this"
,
"
purpose"
,
"
the"
,
"
Gothenburg"
,
"
Young"
,
"
Persons"
,
"
Empowerment"
,
"
Scale"
,
"
("
,
"
GYPES"
,
"
)"
,
"
was"
,
"
developed"
,
"
."
]}
'
-
curl
-X
POST
http://localhost:5003/run_stress_test
-H
"Content-Type:
application/json"
-d
'
{
"
num_requests"
:
50
}
'
-
curl
-X
GET
http://localhost:5003/get_latest_results
dependencies:
-
train
deploy-job
:
# This job runs in the deploy stage.
deploy:
stage
:
deploy
# It only runs when *both* jobs in the test stage complete successfully.
stage:
deploy
environment
:
production
script:
script:
-
echo "Deploying application..."
-
echo
"Deploying
model..."
-
echo "Application successfully deployed."
#
Deployment
steps
go
here,
for
example,
uploading
the
model
to
a
server
dependencies:
-
train
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment