Comments (2)
You need to deploy a custom Docker image in order to do have arbitrary commands executed.
Regarding scrapy-playwright, I have a sample project that demonstrates how to use it on Scrapy Cloud. Disclaimer: this is a personal project, it is NOT an officially supported Scrapy stack.
from shub.
I tried to hack a workaround by messing with the scripts argument using setup.py
script.py
import subprocess
def run_bash_command(command):
try:
result = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
return result.stdout
except subprocess.CalledProcessError as e:
print(f"Error running command: {e}")
return None
commands = ["export PATH=/app/python/bin:$PATH", "playwright install", "playwright install-deps"]
for command in commands:
output = run_bash_command(command)
if output is not None:
print("Command output:")
print(output)```
I'm not sure why this isn't setting the path right to correct the following error in the logs.
`WARNING: The scripts pip, pip3 and pip3.8 are installed in '/app/python/bin' which is not on PATH.`
0: | 2023-07-26 12:39:49 | INFO | Log opened. |
---|---|---|---|
1: | 2023-07-26 12:39:50 | INFO | [stdout] Command output: |
2: | 2023-07-26 12:39:50 | INFO | [stdout] |
3: | 2023-07-26 12:39:50 | INFO | [stdout] Error running command: Command 'playwright install' returned non-zero exit status 127. |
4: | 2023-07-26 12:39:50 | INFO | [stdout] Error running command: Command 'playwright install-deps' returned non-zero exit status 127. |
This works fine on my local environment. Can you explain why this won't work here?
Thanks for sharing the Dockerfile setup, I'm afraid that's the only way for me to get what I want. I really wish there was a feature of opening a bash shell just like in Heroku.
from shub.
Related Issues (20)
- Allow dots in args names
- Incorrect API Key generation URL HOT 3
- shub image upload with arg --apikey doesn't work
- Output of `pwd_git_version` produces invalid Docker tag name
- relax click dependency to make it possible to satisfy other project dependencies
- relax click dependency to make it possible to satisfy other project dependencies HOT 2
- drop support for Python 2.7, 3.5, 3.6
- Configure the latest Scrapy stack by default
- Add support for Python 3.10 HOT 2
- pipenv.utils.convert_deps_to_pip removed HOT 3
- Desktop notification after the deploy finishes HOT 3
- Project-specific requirements
- Python wheels support HOT 3
- Every invocation of `shub` prints `UserWarning: Setuptools is replacing distutils.` HOT 1
- Using deps from `install_requires` if `requirements.txt` is not declared
- link to app.zyte.com instead of app.scrapinghub.com HOT 2
- AttributeError: 'PathDistribution' object has no attribute 'name' HOT 6
- Detected error connecting to Docker daemon's host. (minimum version of 1.24 needed)
- Report endpoint misconfiguration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shub.