This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
test: | |
environment: | |
- PYTHONPATH=./src | |
image: "sparktest" | |
build: | |
context: . | |
dockerfile: ./Dockerfile | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- task: Docker@2 | |
displayName: 'Build an image' | |
inputs: | |
repository: 'sparktest' | |
command: 'build' | |
Dockerfile: '**/Dockerfile' | |
tags: 'latest' | |
- script: | | |
docker run -e PYTHONPATH=./src -v :/app --name sparktest sparktest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WORKDIR app | |
RUN apt-get update && apt-get install -y build-essential libxml2 | |
COPY . /app | |
RUN pip3 install cython numpy pytest pandas coverage pyspark_test dummy_spark IPython pytest-cov | |
RUN pip3 install -r requirements.txt | |
ENTRYPOINT python3 -m coverage run --source=. -m pytest -v test/ && coverage report && coverage xml && cat coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG PYSPARK_VERSION=3.2.0 | |
RUN pip --no-cache-dir install pyspark==${PYSPARK_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG IMAGE_VARIANT=slim-buster | |
ARG OPENJDK_VERSION=8 | |
ARG PYTHON_VERSION=3.9.8 | |
FROM python:${PYTHON_VERSION}-${IMAGE_VARIANT} AS py3 | |
FROM openjdk:${OPENJDK_VERSION}-${IMAGE_VARIANT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.11.2 (main, Mar 1 2023, 14:46:02) [GCC 10.2.1 20210110] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import pandas as pd | |
>>> import numpy as np | |
>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:latest | |
RUN pip install --upgrade pip | |
ADD requirements.txt . | |
RUN pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@704b87b076d8:~# ls /app/ | |
Dockerfile solver.py | |
root@704b87b076d8:~# python /app/solver.py | |
a: 1 | |
b: 10 | |
c: 1 | |
(-0.10102051443364424, -9.898979485566356) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@704b87b076d8:~# python --version | |
Python 3.11.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:latest | |
WORKDIR /app | |
COPY . ./ |
NewerOlder