diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7d76484 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# Nasz obraz będzie dzidziczył z obrazu Ubuntu w wersji latest +FROM ubuntu:latest + +# Instalujemy niezbędne zależności. Zwróć uwagę na flagę "-y" (assume yes) +RUN apt update && apt install -y python3-pip + +RUN pip3 install --user datasets + +# Stwórzmy w kontenerze (jeśli nie istnieje) katalog /app i przejdźmy do niego (wszystkie kolejne polecenia RUN, CMD, ENTRYPOINT, COPY i ADD będą w nim wykonywane) +WORKDIR /app + +# Skopiujmy nasz skrypt do katalogu /app w kontenerze +COPY ./create-dataset.py ./ + +# Domyślne polecenie, które zostanie uruchomione w kontenerze po jego starcie +CMD python3 create-dataset.py \ No newline at end of file diff --git a/create-dataset.Jenkinsfile b/create-dataset.Jenkinsfile index 3f19413..2e84e86 100644 --- a/create-dataset.Jenkinsfile +++ b/create-dataset.Jenkinsfile @@ -1,5 +1,7 @@ pipeline { - agent any + agent { + dockerfile true + } parameters { string ( diff --git a/create-dataset.py b/create-dataset.py new file mode 100644 index 0000000..8fc8ba1 --- /dev/null +++ b/create-dataset.py @@ -0,0 +1,12 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- + +from datasets import load_dataset + + +def create_dataset(): + iris_dataset = load_dataset("scikit-learn/iris") + + +if __name__ == "__main__": + create_dataset()