Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Portia with Docker #269

Closed
agramesh opened this issue Sep 3, 2015 · 15 comments
Closed

Running Portia with Docker #269

agramesh opened this issue Sep 3, 2015 · 15 comments

Comments

@agramesh
Copy link

agramesh commented Sep 3, 2015

For windows machine I installed docker and this command "docker build -t portia ." also successfully run . after that i received error while entering this section

docker run -i -t --rm
-v <PROJECT_FOLDER>/data:/app/slyd/data:rw
-p 9001:9001
--name portia
portia

how configure this command and what is <PROJECT_FOLDER>. Could please help on this to test.

@ruairif
Copy link
Contributor

ruairif commented Sep 3, 2015

There is a missing \.
#249

@agramesh
Copy link
Author

agramesh commented Sep 8, 2015

I have tried the following command which has showed in the error image, but it has still seem same error. Please let me know what are the steps would follow to run the portia for render javascript page.
error

Hope your help kind and need,
Best.

@dvdbng
Copy link
Contributor

dvdbng commented Sep 8, 2015

Hi,

you have to build the image first: docker build -t portia . in repository root.

@agramesh
Copy link
Author

agramesh commented Sep 8, 2015

Hi,
Actually i am checking in windows using docker.
Yes I ran this command before it in
c:protia> root. Its installed all the packages.
before

@dvdbng
Copy link
Contributor

dvdbng commented Sep 8, 2015

What's the output of docker images ?
On Sep 8, 2015 8:45 PM, "agramesh" notifications@github.com wrote:

Hi,
Actually i am checking in windows using docker.
Yes I ran this command before it in
c:protia> root. Its installed all the packages.
[image: before]
https://cloud.githubusercontent.com/assets/11834931/9736269/ca65860e-565d-11e5-8e47-c070716ddb7e.jpg


Reply to this email directly or view it on GitHub
#269 (comment).

@agramesh
Copy link
Author

agramesh commented Sep 8, 2015

I cant analyze about the docker images and how can access it?

@dvdbng
Copy link
Contributor

dvdbng commented Sep 9, 2015

Just type "docker images" in the terminal where you type ask the docker
commands.
On Sep 8, 2015 10:23 PM, "agramesh" notifications@github.com wrote:

I cant analyze about the docker images and how can access it?


Reply to this email directly or view it on GitHub
#269 (comment).

@agramesh
Copy link
Author

Hi
I got the image list, thank you..
docker images

I checked two commands to run portia, but received error.

  1. docker run -i -t --rm -v /<C:/portia/Projects>/data:rw -p 9001:9001 --name portia portia
  2. docker run -i --tty=false --rm -v /<C:/portia/Projects>/data:rw -p 9001:9001 --name portia portia
    error

is the above command correct..
Thanks in advance

@dvdbng
Copy link
Contributor

dvdbng commented Sep 11, 2015

Hi,

there are some problems with the command, try it like this:
docker run -i -t --rm -p 9001:9001 --name portia portia

The syntax you are using to mount the volume is not correct but it's not
necessary to do unless you want to modify the files inside portia.

2015-09-11 11:18 GMT+06:30 agramesh notifications@github.com:

Hi
I got the image list, thank you..
[image: docker images]
https://cloud.githubusercontent.com/assets/11834931/9807246/2a5f0014-586e-11e5-9cac-78489c637c55.jpg

I checked two commands to run portia, but received error.

  1. docker run -i -t --rm -v //data:rw -p 9001:9001 --name portia portia
  2. docker run -i --tty=false --rm -v //data:rw -p 9001:9001 --name portia
    portia
    [image: error]
    https://cloud.githubusercontent.com/assets/11834931/9807251/31afb002-586e-11e5-8a2a-ace76e73f644.jpg

is the above command correct..
Thanks in advance


Reply to this email directly or view it on GitHub
#269 (comment).

@agramesh
Copy link
Author

Hi
thank you for response
here we faced some more new issues, we tried in many ways which more options
but shows error

error1

If i delete the previous portia or Image ID, its displays error as " Unable to find image, Error: image library/portia:latest not found"

@dvdbng
Copy link
Contributor

dvdbng commented Sep 16, 2015

Hi, Run the command without -t and -i because your terminal doesn't have tty suport.

The image once build shouldn't be removed, but you need to remove the container before creating it again: docker rm -f portia

@psychok7
Copy link

psychok7 commented Feb 9, 2016

i am also running into these errors when trying to run with docker #337

@agramesh
Copy link
Author

agramesh commented Mar 7, 2016

Hi I installed portia-portia-16.02.2 using docker in windows, and i can open the portia UI in browser using http://<>:9001/static/index.html. And I use the command
docker run -i --rm -p 9001:9001 --name portia portia
for loading portia, but the spdier didn't stored anywhere in my machine even i used the following command
docker run -i -t --rm -v <PROJECT_FOLDER>/data:/app/slyd/data:rw -p 9001:9001 --name portia portia. how could i resolve this.
thanks.

@agramesh
Copy link
Author

i tried many ways in windows using docker, i can create a spider in portia but the spider didn't store anywhere,
i use the following command to run portia

  • docker run -i --rm -v portia-data:/C/portia/portia/slyd/slyd/data/projects:rw -p 9001:9001 portia
  • docker run -i --rm -v portia-data:/C/portia/portia/slyd/slyd/data/projects:rw -p 9001:9001 --name portia portia
  • docker run -i --rm -v portia-data:/mnt/sda1/var/lib/docker/volumes/portia-data/_data:rw -p 9001:9001 portia

*and this is the log report of portia run : *
$ docker run -i --rm -v portia-data:/C/portia/portia/slyd/slyd/data/projects:rw -p 9001:9001 portia
2016-03-21 07:36:57+0000 [-] Log opened.
2016-03-21 07:36:57.488072 [-] Splash version: 2.0.3
2016-03-21 07:36:57.491375 [-] WARNING: Lua scripting is not available because 'lupa' Python package is not installed
2016-03-21 07:36:57.491988 [-] Qt 5.5.1, PyQt 5.5.1, WebKit 538.1, sip 4.17, Twisted 15.4.0
2016-03-21 07:36:57.492536 [-] Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
2016-03-21 07:36:57.494495 [-] Open files limit: 1048576
2016-03-21 07:36:57.494871 [-] Can't bump open files limit
2016-03-21 07:36:57.693320 [-] Xvfb is started: ['Xvfb', ':1', '-screen', '0', '1024x768x24']
2016-03-21 07:36:58.671847 [-] /app/slyd/slyd/bot.py:25: scrapy.exceptions.ScrapyDeprecationWarning: Module scrapy.log has been deprecated, Scrapy now relies on the builtin Python library for logging. Read the updated logging entry in the documentation to learn more.
2016-03-21 07:36:58.692265 [-] /app/slyd/slyd/bot.py:32: scrapy.exceptions.ScrapyDeprecationWarning: Module scrapy.spider is deprecated, use scrapy.spiders instead
2016-03-21 07:36:58.849269 [-] /app/slyd/slyd/bot.py:60: scrapy.exceptions.ScrapyDeprecationWarning: log.msg has been deprecated, create a python logger and log through it instead
2016-03-21 07:36:58.854114 [-] Site starting on 9002
2016-03-21 07:36:58.855237 [-] Starting factory <slyd.server.Site instance at 0x7fa0cd261cb0>
2016-03-21 07:37:37.188706 [-] "127.0.0.1" - - [21/Mar/2016:07:37:36 +0000] "GET /projects HTTP/1.0" 200 3 "http://192.168.99.100:9001/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
2016-03-21 07:37:38.421122 [HTTPChannel,0,127.0.0.1] u'Websocket Closed: id=c0d4-4526-0dd2 t=2.479958791 user=defaultuser command='
2016-03-21 07:37:38.425827 [-] "127.0.0.1" - - [21/Mar/2016:07:37:37 +0000] "GET /static/index.html HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
2016-03-21 07:37:38.471776 [-] "127.0.0.1" - - [21/Mar/2016:07:37:37 +0000] "GET /assets/vendor-7aa60b34372048e885d47adc8f997f8b.css HTTP/1.0" 304 - "http://192.168.99.100:9001/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
2016-03-21 07:37:38.478261 [-] "127.0.0.1" - - [21/Mar/2016:07:37:37 +0000] "GET /assets/vendor-dfc2f09645d0591fcddf9411517048e0.js HTTP/1.0" 304 - "http://192.168.99.100:9001/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
2016-03-21 07:37:38.481423 [-] "127.0.0.1" - - [21/Mar/2016:07:37:37 +0000] "GET /assets/portia-web-10aafa3f812e9d1f7505f50c8e6a3126.js HTTP/1.0" 304 - "http://192.168.99.100:9001/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"
2016-03-21 07:37:38.487434 [-] "127.0.0.1" - - [21/Mar/2016:07:37:37 +0000] "GET /assets/portia-web-9868cad3b1d799caad870da06516b5c7.css HTTP/1.0" 304 - "http://192.168.99.100:9001/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"

and this is the inspect details of portia :

$ docker inspect portia
[{
"Id": "f9a7e4628feb1199c1d988b776e14cb494ffedcaf1dcaa1719a12051426cf46c",
"Created": "2016-03-21T07:02:16.004148634Z",
"Path": "/bin/sh",
"Args": [
"-c",
"service nginx start; bin/slyd -p 9002 -r /app/slyd/dist"
],
"State": {
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1594,
"ExitCode": 0,
"Error": "",
"StartedAt": "2016-03-21T07:02:16.191515749Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "817f930bf5671a99250c025752fbc18a69ee639b03d31c346e48bfe148250556",
"NetworkSettings": {
"Bridge": "",
"EndpointID": "81ce78f8210ac74d8f46fcd5e6fc3cf85f7b7bc93c13dbd0fa7fd3ece 81399a4",
"Gateway": "172.17.42.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"HairpinMode": false,
"IPAddress": "172.17.0.1",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:01",
"NetworkID": "d3b8690b8ab746fdc124c1f3624ac5f69fabb1befc05dbb1c48f0805a6 1b05bf",
"PortMapping": null,
"Ports": {
"9001/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "9001"
}
]
},
"SandboxKey": "/var/run/docker/netns/f9a7e4628feb",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
},
"ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/f9a7e4628feb1199c1d98 8b776e14cb494ffedcaf1dcaa1719a12051426cf46c/resolv.conf",
"HostnamePath": "/mnt/sda1/var/lib/docker/containers/f9a7e4628feb1199c1d988b 776e14cb494ffedcaf1dcaa1719a12051426cf46c/hostname",
"HostsPath": "/mnt/sda1/var/lib/docker/containers/f9a7e4628feb1199c1d988b776 e14cb494ffedcaf1dcaa1719a12051426cf46c/hosts",
"LogPath": "/mnt/sda1/var/lib/docker/containers/f9a7e4628feb1199c1d988b776e1 4cb494ffedcaf1dcaa1719a12051426cf46c/f9a7e4628feb1199c1d988b776e14cb494ffedcaf1d caa1719a12051426cf46c-json.log",
"Name": "/portia",
"RestartCount": 0,
"Driver": "aufs",
"ExecDriver": "native-0.2",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"portia-data:/C/portia/portia/slyd/slyd/data/projects:rw"
],
"ContainerIDFile": "",
"LxcConf": [],
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"CpuPeriod": 0,
"CpusetCpus": "",
"CpusetMems": "",
"CpuQuota": 0,
"BlkioWeight": 0,
"OomKillDisable": false,
"MemorySwappiness": null,
"Privileged": false,
"PortBindings": {
"9001/tcp": [
{
"HostIp": "",
"HostPort": "9001"
}
]
},
"Links": null,
"PublishAllPorts": false,
"Dns": null,
"DnsSearch": null,
"ExtraHosts": null,
"VolumesFrom": null,
"Devices": [],
"NetworkMode": "bridge",
"IpcMode": "",
"PidMode": "",
"UTSMode": "",
"CapAdd": null,
"CapDrop": null,
"GroupAdd": null,
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"SecurityOpt": null,
"ReadonlyRootfs": false,
"Ulimits": null,
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"CgroupParent": "",
"ConsoleSize": [
0,
0
]
},
"GraphDriver": {
"Name": "aufs",
"Data": null
},
"Volumes": {
"/C/portia/portia/slyd/slyd/data/projects": "/mnt/sda1/var/lib/docker/vo lumes/portia-data/_data"
},
"VolumesRW": {
"/C/portia/portia/slyd/slyd/data/projects": true
},
"Config": {
"Hostname": "f9a7e4628feb",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"9001/tcp": {}
},
"PublishService": "",
"Tty": false,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"PYTHONPATH=/app/slybot:/app/slyd"
],
"Cmd": [
"/bin/sh",
"-c",
"service nginx start; bin/slyd -p 9002 -r /app/slyd/dist"
],
"Image": "portia",
"Volumes": null,
"VolumeDriver": "",
"WorkingDir": "/app/slyd",
"Entrypoint": null,
"NetworkDisabled": false,
"MacAddress": "",
"OnBuild": null,
"Labels": {},
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"Cpuset": ""
}
}
]

@agramesh
Copy link
Author

agramesh commented Apr 5, 2016

The portia can run using docker and create spiders in centos and windows.

@agramesh agramesh closed this as completed Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants