-
Notifications
You must be signed in to change notification settings - Fork 667
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 RPA-Python in Docker - some thoughts and caveats I have #140
Comments
Hi @ck81 I'm afraid I have not tried that and have no in depth experience with Docker images. It looks like this image has the highest download count, you may want to start with that to try - Some thoughts -
Overall, I think it's a great idea to conduct your class with a standardised image, so that the environment is already there. and not have to deal with env setup problems (which isn't the focus of your class). Yes I have conducted a class once last year, and I was surprised that installing Python is an uphill almost impossible tasks for some attendees! Because their company IT policy has certain firewall or app restrictions that make it really hard to install something which we assume is straightforward like Python. |
Hi @kensoh, Thanks for the many pointers! Yes, I intend to use Docker to run only your RPA-Python within Linux, and for web-apps only. Will give it a try and share with you more later if I can get it to work. |
Hi All, i was make a docker images for this rpa project, you can try this in docker hub |
Hello @dpnthanh , I need to run rpa-python on a python larger than 3 and wanted to know what steps you used to create the image. If you could give me a direction or help I would be very grateful. Thanks for listening. |
Hi @Inaldomarinho , One of my projects needs to use RPA-Python on AWS SAM, my leader and i built a Dockerfile and I pushed its images to DockerHub. It uses python3.8 and chrome. |
I am trying to run RPA Web automation with airflow from within a docker container. @dpnthanh I saw and used your image, and you were able to make RPA work within a docker container. But I didn't see a docker file that shows what's actually inside of the container. for security purposes, I would like to re-create it. My end goal is to add the necessary dependencies onto an existing image that holds my airflow and other services. @kensoh Do you have any insight into this, potentially able to showcase what I would need? After installing Chrome on my container, installing and importing RPA it endlessly waits in r.init(). When I interrupt it with 'keyboard interrupt this is the trace: (I added the "headless" and "read" print statements for testing: |
is there any way to share your docker file? it is not included on your image repo |
Hi Guys, nice discussion here on running with Docker and on Linux! Recently, I created a working example using Google Colab, you can check out or make copy of the notebook below to see some of the things done to make it work there. Google Colab - https://colab.research.google.com/drive/13bQO6G_hzE1teX35a3NZ4T5K-ICFFdB5?usp=sharing Namely, if using Chromium instead of Chrome, need to change a setting in the TagUI engine. If running in headless mode (without display and monitor), you can now do it with v1.34 headless option. For running as root, Chromium/Chrome doesn't allow that for security reasons, so a change in run flag is needed. Other than above, Ubuntu will require installing PHP because it does not come with PHP. And using computer vision and OCR stuffs will require installing OpenCV and Tesseract - https://sikulix-2014.readthedocs.io/en/latest/newslinux.html Also, this RPA for Python package is based on a forked version of TagUI open-source RPA tool. |
Thank you for your amazingly quick reply. I used your notebook and followed your instructions with the exception of having to use 'apt install chromium' instead of 'apt install chromium-browser as I'm using Debian. The setup and replacing of the strings in the tagui file worked, but when it came to initialize with r.init() it hung and required keyboard interrupt to see where it was stuck: Do you know what I'm missing or what else I can try. Here is a screenshot of both my terminal showing success in the installs and my notebook: |
Hi @jamesmnixon a few ideas to try -
|
Adding on, some time back a user has an unknown issue starting Chrome because his company network policy blocks Chrome from serving a local web socket connection. The TagUI engine requires that web socket connection as a backdoor to control Chrome. For him, the issue was fixed by tweaking the network policy or adding some exception. |
Want to update back here that James joined the call and problem resolved -
|
@kensoh |
Hi @jamesmnixon I see, it looks like the website has anti-automation checks when running on the container. I've heard good review before on 2captcha, a very affordable service provider that can automate solving captchas through API. You can see if below is useful - https://2captcha.com/recaptchav2_eng_instruction Alternatively, I heard that some folks set up Xvbf to create a virtual display to run Chrome or visual automation on their Linux instances. You can also try settting up Xvbf and run Chrome in the normal visible mode through Xvbf and see whether such setup will still prompt for this captcha check. I haven't tried out Xvbf myself, but below gives an idea of what it involves - https://gist.github.com/addyosmani/5336747 |
Hi all, Anyway i am pretty lost on where to find |
I haven't heard of this from users, it seems to be some Docker issue affecting different apps - broken pipe error on Docker The line that triggered error is below in
You can try setting to below to see if that works. But if there is some root cause related to Docker that running pwd command can trigger errors, there might be a lot more of similar errors that happening before TagUI can run successfully.
|
thanks for the prompt update! i tried the change you mentioned above, and i encountered a fresh new error which i will be trying to solve if possible.
|
Hi @richylyq I'm sorry I made a mistake, the change below should be the full path and filename for the script that you are running. Can you type add this in your Python program
Hopefully that will give more clues what is going on. I suspect it's probably the way the tool is being used isn't doable out of the box because when TagUI run normal shell commands using $() like pwd it gets broken pipe error. It might be OS or environment related issue. But you can first try changing how the package and TagUI works to see if that helps. |
Hi @kensoh i made the switch and the new broken pipe error is shown to be coming from the or could this be affected by the base image i used for my Docker container if it's an environment related issue.. 🤔 what did the other TagUI users that successfully integrated Docker with TagUI use to build |
File permission issue could be possible. You can The There are a lot more of This is an example of the package running on Ubuntu on Google Colab - https://colab.research.google.com/drive/13bQO6G_hzE1teX35a3NZ4T5K-ICFFdB5?usp=sharing This is a working Docker example with both TagUI and RPA for Python. It's created by @skadefro as an image to provision TagUI instances on his open-source OpenFlow app - https://hub.docker.com/r/openiap/nodered-tagui |
You should probably link to the Dockerfile too |
Thanks @skadefro this is very helpful. I forgot where to find this Docker file for your image, now I know. |
can python-rpa run on linux? Do you have a full demo? |
Yes, see this working Google Colab example running on Ubuntu Linux - https://colab.research.google.com/drive/13bQO6G_hzE1teX35a3NZ4T5K-ICFFdB5?usp=sharing |
Hello i tried rpa locally in my computer and it worked correctly. Now i wanna execute it inside a docker container, through airflow's PythonOperator and i'm having serious trouble setting it up, been trying things for many days now!! The latest thing u've tried is this https://colab.research.google.com/drive/13bQO6G_hzE1teX35a3NZ4T5K-ICFFdB5?usp=sharing#scrollTo=kl58MzRLyNgb with the only difference that instead of installing chromium-browser i install chromium, and when doing the dump, i replace "google-chrome" with "chromium" This is my dump code: current_dir = os.path.realpath(os.path.dirname(file)) self.robot.dump( I have error and debug set to True. This is the output i get: [RPA][INFO] - setting up TagUI for use in your Python environment The following command is executed to start TagUI - It leads to following output when starting TagUI - Exception initializing RPA: I'm doing this, since i wanna replicate what i will need to do in production, where i have airflow running in an AWS EC2 instance with Ubuntu |
From above log, it looks like for some reason, the file you edited somehow did not get updated to use Chromium. You can edit this file manually |
Hi @kensoh,
Was wondering if you have tried, or know of any users, running RPA-Python in Docker?
See. I have conducted 2 runs of RPA classes to our Master's students at the National University of Singapore - using TagUI as the RPA tool to illustrate the many key concepts of RPA . In class, there were students that use Windows 10, Mac and Linux. And for both classes, there were always some students that have problems setting up TagUI e.g. missing DLL, missing lib, missing java library, problem with username with space, etc. Some students even have problem setting up Python!
That's why for my 3rd run of the RPA class, I want to set up a self-contained environment using VirtualBox or Docker - with Python and RPA-Python all setup and ready to run. I have no problem setting up VirtualBox. But I'm very new to Docker. Heard many good things about Docker and wanted to give it a try.
I saw that there are 5 TagUI docker image in Docker Hub: https://hub.docker.com/search?q=tagui&type=image
Are you aware of them? Have you tried any of them?
Also, as I'm new to Docker, it seems that when running TagUI in Docker, it's mostly in headless mode. Is that right?
Are you aware of any way to set up a Docker with the standard GUI, i.e. running a Chrome browser inside a Docker with the ability to interactively use the Chrome Developer Tool - just like the way we use VirtualBox?
The text was updated successfully, but these errors were encountered: