Merge pull request #39 from yardstick/feature/QUANT-3102
QUANT-3102: use Nexus to do builds
This commit is contained in:
commit
4fe8308e94
@ -1,25 +0,0 @@
|
|||||||
FROM python:3.9.6
|
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get -y install coinor-cbc
|
|
||||||
RUN python -m pip install pulp
|
|
||||||
RUN python -m pip install pydantic
|
|
||||||
RUN python -m pip install daemonize
|
|
||||||
RUN python -m pip install sqspy
|
|
||||||
RUN python -m pip install -U pytest
|
|
||||||
RUN python -m pip install pytest-cov
|
|
||||||
RUN python -m pip install pytest-stub
|
|
||||||
RUN python -m pip install pytest-mock
|
|
||||||
RUN python -m pip install girth --upgrade
|
|
||||||
|
|
||||||
RUN mkdir /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV LOCAL_DEV True
|
|
||||||
|
|
||||||
# Bundle app source
|
|
||||||
COPY . /app
|
|
||||||
|
|
||||||
WORKDIR /app/app
|
|
||||||
|
|
||||||
CMD [ "python", "main.py" ]
|
|
48
.vagrantrc
48
.vagrantrc
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
. $MEASURE_SRC_PATH/.vagrantrc
|
|
||||||
|
|
||||||
[ ! -f docker-compose.override.yml ] && cat <<YAML > docker-compose.override.yml
|
|
||||||
override_file_placeholder:
|
|
||||||
image: busybox
|
|
||||||
YAML
|
|
||||||
|
|
||||||
measure-vagrant-id() {
|
|
||||||
vagrant global-status | grep 'yardstick\s*$' | awk '{ print $1 }'
|
|
||||||
}
|
|
||||||
|
|
||||||
vagrant-shell() {
|
|
||||||
vagrant ssh `measure-vagrant-id`
|
|
||||||
}
|
|
||||||
|
|
||||||
vagrant-ssh() {
|
|
||||||
vagrant ssh `measure-vagrant-id` -c "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
compose() {
|
|
||||||
vagrant-ssh "cd /apps/measure-solver && \\
|
|
||||||
docker-compose -f '/app/docker-compose.yml' \\
|
|
||||||
-f '/apps/measure-solver/docker-compose.yml' \\
|
|
||||||
-f '/apps/measure-solver/docker-compose.override.yml' \\
|
|
||||||
$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
run() {
|
|
||||||
compose "run --rm measure-solver $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
run-script() {
|
|
||||||
run "rails $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
measure-solver-logs() {
|
|
||||||
compose "logs measure-solver"
|
|
||||||
}
|
|
||||||
|
|
||||||
restart-measure-solver() {
|
|
||||||
compose "restart measure-solver"
|
|
||||||
}
|
|
||||||
|
|
||||||
rails() {
|
|
||||||
run-script "$*"
|
|
||||||
}
|
|
31
Dockerfile
31
Dockerfile
@ -1,23 +1,26 @@
|
|||||||
FROM python:3.9.6
|
FROM python:3.9.6 AS base
|
||||||
|
LABEL maintainer='Meazure Developers <devs@getyardstick.com>'
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get -y install coinor-cbc
|
RUN apt-get -y install coinor-cbc
|
||||||
RUN python -m pip install pulp
|
|
||||||
RUN python -m pip install pydantic
|
ARG PIP_INDEX_URL
|
||||||
RUN python -m pip install daemonize
|
ARG PIP_INDEX
|
||||||
RUN python -m pip install sqspy
|
|
||||||
RUN python -m pip install -U pytest
|
ENV PIP_INDEX_URL $PIP_INDEX_URL
|
||||||
RUN python -m pip install pytest-cov
|
ENV PIP_INDEX $PIP_INDEX
|
||||||
RUN python -m pip install pytest-stub
|
ENV PIP_TARGET /pip
|
||||||
RUN python -m pip install pytest-mock
|
ENV PYTHONPATH /pip
|
||||||
RUN python -m pip install girth --upgrade
|
|
||||||
|
|
||||||
RUN mkdir /app
|
RUN mkdir /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Bundle app source
|
CMD [ "python", "app/main.py" ]
|
||||||
|
|
||||||
|
FROM base AS development
|
||||||
|
|
||||||
|
FROM base
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
WORKDIR /app/app
|
RUN python -m pip install -r requirements.txt
|
||||||
|
|
||||||
CMD [ "python", "main.py" ]
|
|
||||||
|
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@ -11,6 +11,16 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Build Kaniko image') {
|
stage('Build Kaniko image') {
|
||||||
steps {
|
steps {
|
||||||
|
withVault([ vaultSecrets: [
|
||||||
|
[
|
||||||
|
path: "ci/general",
|
||||||
|
engineVersion: 1,
|
||||||
|
secretValues: [
|
||||||
|
[envVar: 'PIP_USER', vaultKey: 'SONATYPE_READONLY_USER'],
|
||||||
|
[envVar: 'PIP_PASSWORD', vaultKey: 'SONATYPE_READONLY_USER_PASSCODE']
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]]) {
|
||||||
withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
|
withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
|
||||||
container('kaniko') {
|
container('kaniko') {
|
||||||
checkout scm
|
checkout scm
|
||||||
@ -23,6 +33,8 @@ pipeline {
|
|||||||
--insecure=true \
|
--insecure=true \
|
||||||
--insecure-registry=docker-registry.default:5000 \
|
--insecure-registry=docker-registry.default:5000 \
|
||||||
--cache=true \
|
--cache=true \
|
||||||
|
--build-arg PIP_INDEX_URL=https://${PIP_USER}:${PIP_PASSWORD}@artifact.it.getyardstick.com/repository/meazurelearning-pypi/simple \
|
||||||
|
--build-arg PIP_INDEX=https://${PIP_USER}:${PIP_PASSWORD}@artifact.it.getyardstick.com/repository/meazurelearning-pypi/pypi \
|
||||||
--cache-repo=docker-registry.default:5000/${REPOSITORY} \
|
--cache-repo=docker-registry.default:5000/${REPOSITORY} \
|
||||||
--destination ${env.REPOSITORY}:\$(echo ${BRANCH_NAME} | grep -Eo 'feature/([A-Za-z]+-[0-9]*)' | grep -Eo '[A-Za-z]+-[0-9]*' || \
|
--destination ${env.REPOSITORY}:\$(echo ${BRANCH_NAME} | grep -Eo 'feature/([A-Za-z]+-[0-9]*)' | grep -Eo '[A-Za-z]+-[0-9]*' || \
|
||||||
echo ${BRANCH_NAME} | grep -Eo '(release|hotfix)/[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' | grep -Eo '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' || \
|
echo ${BRANCH_NAME} | grep -Eo '(release|hotfix)/[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' | grep -Eo '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' || \
|
||||||
@ -33,4 +45,5 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from girth import ability_mle
|
from mirth import ability_mle
|
||||||
|
|
||||||
from lib.irt.models.base import *
|
from lib.irt.models.base import *
|
||||||
|
|
||||||
|
9
rc
9
rc
@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
export MEASURE_SRC_PATH=../yardstick
|
|
||||||
|
|
||||||
if [ -f .user_rc ]; then
|
|
||||||
. .user_rc
|
|
||||||
fi
|
|
||||||
|
|
||||||
source .vagrantrc
|
|
9
requirements.txt
Normal file
9
requirements.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
daemonize==2.5.0
|
||||||
|
mirth==0.10.3
|
||||||
|
PuLP==2.7.0
|
||||||
|
pydantic==2.4.2
|
||||||
|
pytest==7.4.2
|
||||||
|
pytest-cov==4.1.0
|
||||||
|
pytest-mock==3.11.1
|
||||||
|
pytest-stub==1.1.0
|
||||||
|
sqspy==1.0.0
|
Loading…
x
Reference in New Issue
Block a user