Skip to content

Commit

Permalink
deploy-package is ossible
Browse files Browse the repository at this point in the history
  • Loading branch information
dido18 committed Jan 19, 2017
1 parent 5404a17 commit 0b89414
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 3 additions & 4 deletions analysis/Dockerfile_scanner
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ RUN mkdir /code
WORKDIR /code

COPY pyFinder/requirements.txt /code/

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# ADD . /code/

# install pyfinder module in the container
# ADD setup.py /code
# RUN python setup.py install

COPY pyFinder/ /code

COPY deploy-package/analysis.py /code/pyfinder

ENTRYPOINT ["python","/code/entryScanner.py"]
CMD ["--help"]
7 changes: 7 additions & 0 deletions analysis/deploy-package/analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@




def handler_analysis(image_name, context):
print ("Hello world "+ image_name)
print (context.get_images())
Empty file.
7 changes: 7 additions & 0 deletions analysis/pyFinder/pyfinder/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .client_software import ClientSoftware
from .consumer_rabbit import ConsumerRabbit
from pyfinder.model.image import Image
from pyfinder.analysis import handler_analysis
import logging
import datetime
import sys
Expand All @@ -21,6 +22,8 @@ def __init__(self, amqp_url='amqp://guest:[email protected]:5672', exchange=None,
rmi=True):




self.rmi = rmi # remove an image after it is scanned

self.logger = logging.getLogger(__class__.__name__)
Expand All @@ -29,6 +32,8 @@ def __init__(self, amqp_url='amqp://guest:[email protected]:5672', exchange=None,
# client of Software service: the service that return the software to search in the images.
self.client_software = ClientSoftware(api_url=software_url)



# client of Docker daemon running on the local host
#self.client_daemon = ClientDaemon(base_url='unix://var/run/docker.sock')
self.client_daemon = docker.Client(base_url='unix://var/run/docker.sock')
Expand All @@ -44,6 +49,8 @@ def __init__(self, amqp_url='amqp://guest:[email protected]:5672', exchange=None,
# client of Images Service: in order to add and update the image description.
self.client_images = ClientImages(images_url=images_url)

handler_analysis("ciao", self.client_images)

# client of Docker Hub.
self.client_hub = ClientHub(docker_hub_endpoint=hub_url)

Expand Down

0 comments on commit 0b89414

Please sign in to comment.