Zadanie 2 część 2
This commit is contained in:
parent
9866366769
commit
0a38aa7d86
@ -6,4 +6,5 @@ WORKDIR /app
|
|||||||
COPY ["requirements.txt", "./"]
|
COPY ["requirements.txt", "./"]
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
|
|
||||||
COPY ["Zadanie 1.py", "."]
|
COPY ["Zadanie 1.py", "."]
|
||||||
|
COPY ["stats.py", "."]
|
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -16,7 +16,7 @@ pipeline {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('docker: Download artifacts')
|
stage('download and process data')
|
||||||
{
|
{
|
||||||
steps {
|
steps {
|
||||||
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent {
|
||||||
|
docker { image 'adnovac/ium_s434760:latest' }
|
||||||
|
}
|
||||||
parameters{
|
parameters{
|
||||||
buildSelector(
|
buildSelector(
|
||||||
defaultSelector: lastSuccessful(),
|
defaultSelector: lastSuccessful(),
|
||||||
@ -8,23 +10,12 @@ pipeline {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('checkout: Check out from version control') {
|
|
||||||
steps {
|
|
||||||
git 'https://git.wmi.amu.edu.pl/s434760/ium_434760.git'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('copy artifacts')
|
stage('copy artifacts')
|
||||||
{
|
{
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
copyArtifacts(fingerprintArtifacts: true, projectName: 's434760-create-dataset', selector: buildParameter('WHICH_BUILD'))
|
copyArtifacts(fingerprintArtifacts: true, projectName: 's434760-create-dataset', selector: buildParameter('WHICH_BUILD'))
|
||||||
}
|
sh 'python3.8 stats.py'
|
||||||
}
|
|
||||||
stage('sh: Shell Script')
|
|
||||||
{
|
|
||||||
steps {
|
|
||||||
sh "chmod 777 ./script_stat.sh"
|
|
||||||
sh './script_stat.sh'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('archive artifacts') {
|
stage('archive artifacts') {
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
kaggle datasets download -d karangadiya/fifa19
|
|
||||||
unzip -o fifa19.zip
|
|
||||||
|
|
||||||
x=$(($CUTOFF/10))
|
|
||||||
head -n 1 data.csv > header.csv
|
|
||||||
tail -n +2 data.csv| tail -n $CUTOFF | shuf > data_shuf.csv
|
|
||||||
head -n $(($x*2)) data_shuf.csv > test.csv
|
|
||||||
head -n $(($x*2)) data_shuf.csv | tail -n 3330 > validation.csv
|
|
||||||
tail -n $(($x*6)) data_shuf.csv > train.csv
|
|
@ -1,4 +0,0 @@
|
|||||||
wc -l data_shuf.csv >> stat.txt
|
|
||||||
wc -l train.csv >> stat.txt
|
|
||||||
wc -l test.csv >> stat.txt
|
|
||||||
wc -l validation.csv >> stat.txt
|
|
19
stats.py
Normal file
19
stats.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
stats = []
|
||||||
|
with open("data.csv", "r") as f:
|
||||||
|
lines_count = len(f.readlines())
|
||||||
|
stats.append(f"data.csv - {lines_count} lines\n")
|
||||||
|
|
||||||
|
with open("dev.csv", "r") as f:
|
||||||
|
lines_count = len(f.readlines())
|
||||||
|
stats.append(f"dev.csv - {lines_count} lines\n")
|
||||||
|
|
||||||
|
with open("test.csv", "r") as f:
|
||||||
|
lines_count = len(f.readlines())
|
||||||
|
stats.append(f"test.csv - {lines_count} lines\n")
|
||||||
|
|
||||||
|
with open("train.csv", "r") as f:
|
||||||
|
lines_count = len(f.readlines())
|
||||||
|
stats.append(f"train.csv - {lines_count} lines\n")
|
||||||
|
|
||||||
|
with open("stat.txt", "w+") as f:
|
||||||
|
f.writelines(stats)
|
Loading…
Reference in New Issue
Block a user