hiransarkar
hiransarkar
RRailway
Created by hiransarkar on 7/4/2023 in #✋|help
Plugin was stopped due to exeeding usage limits. Click the button below to start the plugin again!
its working! thanks
15 replies
RRailway
Created by hiransarkar on 7/4/2023 in #✋|help
Plugin was stopped due to exeeding usage limits. Click the button below to start the plugin again!
sorry about that
15 replies
RRailway
Created by hiransarkar on 7/4/2023 in #✋|help
Plugin was stopped due to exeeding usage limits. Click the button below to start the plugin again!
@rayofbytes 54e12b13-1ae4-4c21-99a6-8e1e906bdf34
15 replies
RRailway
Created by hiransarkar on 7/4/2023 in #✋|help
Plugin was stopped due to exeeding usage limits. Click the button below to start the plugin again!
@Brody Any idea for how long?
15 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
Thanks for all the help
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
I got it working! Chromium was a real pain in the ass. I am using google instead. Even though chromium is lightweight. I think I will stick to google chrome for a while. Here is the dockerfile
# Base image
FROM python:3.8.2

# Set the working directory in the container
WORKDIR /app

# Copy the project files to the container
COPY . .

# downloading chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get install -y google-chrome-stable

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port if needed
# EXPOSE <port_number>

# Set environment variables if needed
# ENV <variable_name>=<value>

# Run the command
CMD celery -A backend worker -l INFO --pool=prefork --concurrency=8 & python manage.py migrate && python3 download_resources.py && daphne -b 0.0.0.0 -p $PORT backend.asgi:application
# Base image
FROM python:3.8.2

# Set the working directory in the container
WORKDIR /app

# Copy the project files to the container
COPY . .

# downloading chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get install -y google-chrome-stable

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port if needed
# EXPOSE <port_number>

# Set environment variables if needed
# ENV <variable_name>=<value>

# Run the command
CMD celery -A backend worker -l INFO --pool=prefork --concurrency=8 & python manage.py migrate && python3 download_resources.py && daphne -b 0.0.0.0 -p $PORT backend.asgi:application
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
I was wondering if you have seen anything like this.
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
Hi. I buit the dockerfile, but I am having issues with versioning for Chromedriver and Chromium. They need to be the same.
[nltk_data] Package punkt is already up-to-date!
Traceback (most recent call last):
File "download_resources.py", line 12, in <module>
chrome_driver_path = ChromeDriverManager(chrome_type=ChromeType.CHROMIUM, version=chromium_version).install()
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/chrome.py", line 39, in install
driver_path = self._get_driver_path(self.driver)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/manager.py", line 30, in _get_driver_path
file = self._download_manager.download_file(driver.get_driver_download_url())
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/download_manager.py", line 28, in download_file
response = self._http_client.get(url)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 37, in get
self.validate_response(resp)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 16, in validate_response
raise ValueError(f"There is no such driver by url {resp.url}")
ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/90.0.4430/chromedriver_linux64.zip
Operations to perform:
[nltk_data] Package punkt is already up-to-date!
Traceback (most recent call last):
File "download_resources.py", line 12, in <module>
chrome_driver_path = ChromeDriverManager(chrome_type=ChromeType.CHROMIUM, version=chromium_version).install()
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/chrome.py", line 39, in install
driver_path = self._get_driver_path(self.driver)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/manager.py", line 30, in _get_driver_path
file = self._download_manager.download_file(driver.get_driver_download_url())
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/download_manager.py", line 28, in download_file
response = self._http_client.get(url)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 37, in get
self.validate_response(resp)
File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 16, in validate_response
raise ValueError(f"There is no such driver by url {resp.url}")
ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/90.0.4430/chromedriver_linux64.zip
Operations to perform:
Here is the code, which gets the version of the chromium and then downloads the chrome driver for that specific version
import nltk
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType, read_version_from_cmd, PATTERN

# downloading punkt
nltk.download('punkt')

# Get the version of Chromium
chromium_version = read_version_from_cmd("/usr/bin/chromium --version", PATTERN[ChromeType.CHROMIUM])

# Install the corresponding version of ChromeDriver
chrome_driver_path = ChromeDriverManager(chrome_type=ChromeType.CHROMIUM, version=chromium_version).install()
import nltk
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType, read_version_from_cmd, PATTERN

# downloading punkt
nltk.download('punkt')

# Get the version of Chromium
chromium_version = read_version_from_cmd("/usr/bin/chromium --version", PATTERN[ChromeType.CHROMIUM])

# Install the corresponding version of ChromeDriver
chrome_driver_path = ChromeDriverManager(chrome_type=ChromeType.CHROMIUM, version=chromium_version).install()
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
once i have the docker file, do i need to delete the proc file, runtime.txt and nixpacks.toml?
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
you wouldn't believe me when i tell this but, you helped me a lot today. thanks man.
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
yeah. i thought maybe railway, provides the template for a dockerfile. or something
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
could you point me to sources that i can refer to for a Dockerfile based build. I am not really familiar with docker.
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
thanks!
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
does railway automcatically picks up the nixpacks.toml file form the repository? or do i need to mention it in the proc file?
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
does proc file support apt-get install?
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
okay.. I think then the proc file should look like this?
celery -A backend worker --pool=prefork --concurrency=8 & python manage.py migrate && python3 download_resources.py && apt-get update && apt-get install -y google-chrome-stable && daphne -b 0.0.0.0 -p $PORT backend.asgi:application
celery -A backend worker --pool=prefork --concurrency=8 & python manage.py migrate && python3 download_resources.py && apt-get update && apt-get install -y google-chrome-stable && daphne -b 0.0.0.0 -p $PORT backend.asgi:application
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
yeah. i didn't think it would be a problem, since it was open source
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
or I think so. I am scraping one of the pages of langchain docs
52 replies
RRailway
Created by hiransarkar on 6/3/2023 in #✋|help
Deploying Django with celery
yes, it does.
52 replies