From f2324c26136362f408932dd482c1bec071a16c71 Mon Sep 17 00:00:00 2001 From: brmnjsh Date: Wed, 29 Nov 2023 23:18:59 +0000 Subject: [PATCH] get requirements.txt working --- .docker-compose/Dockerfile | 3 +- .vagrantrc | 48 --------------------- Dockerfile | 23 ++++++---- app/lib/irt/models/rasch.py | 2 +- pip.conf | 5 ++- rc | 9 ---- requirements.txt | 84 +------------------------------------ 7 files changed, 22 insertions(+), 152 deletions(-) delete mode 100644 .vagrantrc delete mode 100644 rc diff --git a/.docker-compose/Dockerfile b/.docker-compose/Dockerfile index 09ece98..3fb53cd 100644 --- a/.docker-compose/Dockerfile +++ b/.docker-compose/Dockerfile @@ -3,7 +3,8 @@ FROM python:3.9.6 ARG NEXUS_TOKEN ENV PIP_CONFIG_FILE pip.conf -ENV NEXUS_TOKEN $NEXUS_TOKEN +ENV PYTHONPATH /pip +ENV NEXUS_TOKEN $NEXUS_TOKEN RUN apt-get update RUN apt-get -y install coinor-cbc diff --git a/.vagrantrc b/.vagrantrc deleted file mode 100644 index ddc7b4d..0000000 --- a/.vagrantrc +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -. $MEASURE_SRC_PATH/.vagrantrc - -[ ! -f docker-compose.override.yml ] && cat < 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 "$*" -} diff --git a/Dockerfile b/Dockerfile index 3ac7e53..64b0312 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,15 @@ -FROM python:3.9.6 +FROM python:3.9.6 AS base +LABEL maintainer='Meazure Developers ' ARG NEXUS_TOKEN +ARG NEXUS_USER +ARG NEXUS_PASS -ENV PIP_INDEX https://$NEXUS_TOKEN@artifact.it.getyardstick.com/repository/meazurelearning-pypi/pypi -ENV PIP_INDEX_URL https://$NEXUS_TOKEN@artifact.it.getyardstick.com/repository/meazurelearning-pypi/simple +ENV PIP_CONFIG_FILE pip.conf +ENV PYTHONPATH /pip +ENV NEXUS_TOKEN $NEXUS_TOKEN +ENV NEXUS_USER $NEXUS_USER +ENV NEXUS_PASS $NEXUS_PASS RUN apt-get update RUN apt-get -y install coinor-cbc @@ -11,11 +17,12 @@ RUN apt-get -y install coinor-cbc RUN mkdir /app WORKDIR /app -# Bundle app source +CMD [ "python", "app/main.py" ] + +FROM base AS development + +FROM base + COPY . /app RUN python -m pip install -r requirements.txt - -WORKDIR /app/app - -CMD [ "python", "main.py" ] diff --git a/app/lib/irt/models/rasch.py b/app/lib/irt/models/rasch.py index 96090b5..624e472 100644 --- a/app/lib/irt/models/rasch.py +++ b/app/lib/irt/models/rasch.py @@ -1,4 +1,4 @@ -from girth import ability_mle +from mirth import ability_mle from lib.irt.models.base import * diff --git a/pip.conf b/pip.conf index b347158..5e54d91 100644 --- a/pip.conf +++ b/pip.conf @@ -1,3 +1,4 @@ [global] -index = https://${NEXUS_TOKEN}@artifact.it.getyardstick.com/repository/meazurelearning-pypi/pypi -index-url = https://${NEXUS_TOKEN}@artifact.it.getyardstick.com/repository/meazurelearning-pypi/simple \ No newline at end of file +index = https://gDFaNrUq:GD7Y8tLmE6wYMZAE_JC-SWcImC7TLHB2ut_WLL4w8hBC@artifact.it.getyardstick.com/repository/meazurelearning-pypi/pypi +index-url = https://gDFaNrUq:GD7Y8tLmE6wYMZAE_JC-SWcImC7TLHB2ut_WLL4w8hBC@artifact.it.getyardstick.com/repository/meazurelearning-pypi/simple +target = /pip diff --git a/rc b/rc deleted file mode 100644 index f4b4dd2..0000000 --- a/rc +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -export MEASURE_SRC_PATH=../yardstick - -if [ -f .user_rc ]; then - . .user_rc -fi - -source .vagrantrc diff --git a/requirements.txt b/requirements.txt index 5256f18..8803345 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,91 +1,9 @@ -annotated-types==0.5.0 -attrs==21.2.0 -Automat==20.2.0 -Babel==2.8.0 -bcrypt==3.2.0 -blinker==1.4 -boto3==1.28.58 -botocore==1.31.58 -certifi==2020.6.20 -chardet==4.0.0 -click==8.0.3 -cloud-init==23.1.2 -colorama==0.4.4 -command-not-found==0.3 -configobj==5.0.6 -constantly==15.1.0 -coverage==7.3.2 -cryptography==3.4.8 daemonize==2.5.0 -dbus-python==1.2.18 -distro==1.7.0 -distro-info===1.1build1 -exceptiongroup==1.1.3 -httplib2==0.20.2 -hyperlink==21.0.0 -idna==3.3 -importlib-metadata==4.6.4 -incremental==21.3.0 -iniconfig==2.0.0 -jeepney==0.7.1 -Jinja2==3.0.3 -jmespath==1.0.1 -jsonpatch==1.32 -jsonpointer==2.0 -jsonschema==3.2.0 -keyring==23.5.0 -launchpadlib==1.10.16 -lazr.restfulclient==0.14.4 -lazr.uri==1.0.6 -MarkupSafe==2.0.1 -mirth==0.10.2 -more-itertools==8.10.0 -netifaces==0.11.0 -numpy==1.26.0 -oauthlib==3.2.0 -packaging==23.2 -pexpect==4.8.0 -pluggy==1.3.0 -ptyprocess==0.7.0 +mirth==0.10.3 PuLP==2.7.0 -pyasn1==0.4.8 -pyasn1-modules==0.2.1 pydantic==2.4.2 -pydantic_core==2.10.1 -PyGObject==3.42.1 -PyHamcrest==2.0.2 -PyJWT==2.3.0 -pyOpenSSL==21.0.0 -pyparsing==2.4.7 -pyrsistent==0.18.1 -pyserial==3.5 pytest==7.4.2 pytest-cov==4.1.0 pytest-mock==3.11.1 pytest-stub==1.1.0 -python-apt==2.4.0+ubuntu1 -python-dateutil==2.8.2 -python-debian===0.1.43ubuntu1 -python-magic==0.4.24 -pytz==2022.1 -PyYAML==5.4.1 -requests==2.25.1 -s3transfer==0.7.0 -scipy==1.11.3 -SecretStorage==3.3.1 -service-identity==18.1.0 -six==1.16.0 -sos==4.4 sqspy==1.0.0 -ssh-import-id==5.11 -systemd-python==234 -tomli==2.0.1 -Twisted==22.1.0 -typing_extensions==4.8.0 -ubuntu-advantage-tools==8001 -ufw==0.36.1 -unattended-upgrades==0.1 -urllib3==1.26.5 -wadllib==1.3.6 -zipp==1.0.0 -zope.interface==5.4.0