Error while running a local mlflow server - python

I am trying to run an mlflow server locally.
To do so, I am using:
mlflow server --backend-store-uri="sqlite:///C:\\path\\to\\project_folder\\backend\\mlflow_data.db"
--default-artifact-root="file:///C:\\path\\to\\project_folder\\artifact_store\\"
Where
- backend-store-uri: URI to which to persist experiment and run data (sqlite database in our case).
- default-artifact-root: Local or S3 URI to store artifacts, for new experiments (local folder in our case).
I have already install the packages:
numpy==1.17.3
pandas==0.25.3
jupyterlab==1.0.10
scikit-learn==0.21.3
matplotlib==3.1.2
mlflow==1.4.0
torch==1.3.1+cpu
torchvision==0.4.2+cpu
xgboost==0.90
The problem is that I am getting this error:
Fatal error in launcher: Unable to create process using "d:\bld\mlflow_1572494804636\_h_env\python.exe" "C:\Users\user\AppData\Local\Continuum\miniconda3\envs\mlflow-tut orial\Scripts\mlflow.exe" server --backend-store-uri=sqlite:///C:\\projects\\user\\mlflow_tutorial\\backend\\mlflow_ui_data.db --default-artifact-root=file:///C:\\projects \\user\\mlflow_tutorial\\artifact_store\\
When I run the mlflow server command. Any ideas ?

It seems that there is a space in the path:

Related

Azure Python Function App deployment fails on adding tensorflow to requirements.txt

I have a Python Function App created with Consumption Plan. I am trying to deploy an app that makes use tensorflow using the VS Code Function App extension. But the Deploy to Function App fails on just adding tensorflow to requirements.txt. I get the following error:
collecting tensorflow
6:04:44 am PostComparisonApp: [00:34:44+0000] Downloading tensorflow-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.1 MB)
6:05:10 am PostComparisonApp: Done in 27 sec(s).
6:05:14 am PostComparisonApp: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
6:05:14 am PostComparisonApp: Generating summary of Oryx build
6:05:14 am PostComparisonApp: Deployment Log file does not exist in /tmp/oryx-build.log
6:05:14 am PostComparisonApp: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
6:05:14 am PostComparisonApp: Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
6:05:26 am PostComparisonApp: Deployment failed.
I get this error on no other change to the templace function that is provided on creating function in the extension.
I have also tried running the func azure functionapp publish command as well, but get the same error. I have tried deleting the App and creating new one, but still same error.
This is the way I was able to deploy tensor flow with the azure function.
First inside the folder I create a virtual environment using command
python -m venev test
Then I installed tensorflow using
pip isntall tensorflow
Now I created the function inside the folder and added tensorflow to requirment.txt.
the function just return the version of the tensorflow
function code :
import logging
import tensorflow as tf
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
name = tf.__version__
return func.HttpResponse(name)
Then I just deployed the function to azure
After trying lots of different things, I found that if you use tensorflow-cpu instead of tensorflow in requirements.txt, it deploys just fine.

docker login --username AWS --password-stdin https://<accountNumber>.dkr.ecr.<region>.amazonaws.com exited with error code 1:

I'm simply adopting the Eventbridge ETL design pattern and it gives me this error when I deploy:
[100%] fail: docker login --username AWS --password-stdin https://315997497220.dkr.ecr.us-west-2.amazonaws.com exited with error code 1:
❌ the-eventbridge-etl failed: Error: Failed to publish one or more
assets. See the error messages above for more information. at
Object.publishAssets
(/home/mubashir/.nvm/versions/node/v16.3.0/lib/node_modules/aws-cdk/lib/util/asset-publishing.ts:25:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.deployStack
(/home/mubashir/.nvm/versions/node/v16.3.0/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:237:3)
at CdkToolkit.deploy
(/home/mubashir/.nvm/versions/node/v16.3.0/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:194:24)
at initCommandLine
(/home/mubashir/.nvm/versions/node/v16.3.0/lib/node_modules/aws-cdk/bin/cdk.ts:267:9)
Failed to publish one or more assets. See the error messages above for
more information.
The steps I took. Github repo has a video I followed
npx cdkp init the-eventbridge-etl --lang=python
cd the-eventbridge-etl
python3 -m venv .env
source .env/bin/activate
pip install -r requirements.txt
cdk synth
cdk deploy
The first error I get is related to bootstrapping. So I bootstrap.
export CDK_NEW_BOOTSTRAP=1
npx cdk bootstrap aws://315997497220/us-east-2 --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess --trust 315997497220 aws://315997497220/us-east-2
I've naturally updated the cdk.json file for using the above bootstrapping technique. I've tried all bootstrap techniques, with and without a qualifier, and with its subsequent changes to cdk.json. I don't think it's a bootstrap issue.
I get the above error and I don't know what the issue is. I have not made any changes to the code.
I geuss you need to get and pipe a password first as you use the --password-stdin flag. Try:
aws ecr get-login-password | docker login --username AWS --password-stdin https://315997497220.dkr.ecr.us-west-2.amazonaws.com

ElasticBeanstalk suddenly starts failing to deploy Django App with "Cannot use ImageField because Pillow is not installed" exception

I am using elastic beanstalk to deploy my Django application. Today it suddenly stopped working without any breaking changes from the application side (I've changed some templates, nothing more).
The deployment time outs after 10 minutes of trying to deploy the app and nothing happens.
The only more or less useful hints I can see in the log is this:
[2020-02-20T15:00:20.437Z] INFO [19057] - [Application update .../postbuild_0_myproject/Command 01_migrate] : Activity execution failed, because: SystemCheckError: System check identified some issues:
ERRORS:
education.Author.photo: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
education.Course.cover_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
education.CourseCategory.icon_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
Using staging settings
App receivers connected
(ElasticBeanstalk::ExternalInvocationError)
[2020-02-20T15:00:20.437Z] INFO [19057] - [Application update .../postbuild_0_myproject/Command 01_migrate] : Activity failed.
[2020-02-20T15:00:20.437Z] INFO [19057] - [Application update .../postbuild_0_myproject] : Activity failed.
[2020-02-20T15:00:20.437Z] INFO [19057] - [Application update ...] : Activity failed.
[2020-02-20T15:00:20.507Z] INFO [19057] - [Application update app-9a24-200220_145942-stage-200220_145942#142/AppDeployStage0/EbExtensionPostBuild] : Activity failed.
[2020-02-20T15:00:20.507Z] INFO [19057] - [Application update app-9a24-200220_145942-stage-200220_145942#142/AppDeployStage0] : Activity failed.
[2020-02-20T15:00:20.508Z] INFO [19057] - [Application update app-9a24-200220_145942-stage-200220_145942#142] : Completed activity. Result:
Application update - Command CMD-AppDeploy failed
But I already have Pillow in requirements.txt and the log above says:
Requirement already satisfied: Pillow==6.2.1 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 51))
How can I troubleshoot and fix this? And how can I avoid similar issues in the future? I am really frightened that the same problem may randomly pop out on production environment.
Here's some more info about the configuration:
Here's what I have in .ebextensions:
01_packages.config:
packages:
yum:
git: []
postgresql93-devel: []
db-migrate.config
container_commands:
01_migrate:
command: "django-admin.py migrate"
leader_only: true
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: myproject.settings
django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: myproject/wsgi.py
wsgi_custom.config
files:
"/etc/httpd/conf.d/wsgihacks.conf":
mode: "000644"
owner: root
group: root
content: |
WSGIPassAuthorization On
This one is a pain and a known issue with Django when using the ImageField model/form. Due to Pythons dynamic import system it will suddenly appear and annoyed the hell out of me when I first came across it.
The way I normally fix this is by using conda and its equivalent of a virtualenv to ensure the right interpreter (the one with my packages) is used.
If you are not using a virtualenv or equivalent, set one up now, if you are already using one then check you are installing pillow with pip3 install pillow - the pip3 being important here as on debian (and many other) systems normal pip will only install for python 2.x.
Using conda will ensure this doesnt happen in production, but I would also add it to your checklist of things to test when deploying - check correct version of pillow setup and working.
I had two Elastic Beanstalk environments with the same issue (one web tier env and a worker env).
On one of them the issue was resolved by restarting the environment.
The other one failed to restart and timed out every time on any operation. This one I managed to fix by going to configuration > capacity and changing the minimum and maximum number of instances to 0. I've applied the changes, waited for them to apply and then returned the previous values for min and max instance numbers.
That fixed the issue.
I still have no idea what caused the issue in the first place and would love to receive some comment on that.

Connection refused error with django-elasticsearch-dsl

I'm trying to integrate ElasticSearch with my Django project using the package django-elasticsearch-dsl, and I am getting this error:
>> $ curl -X GET http://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
I downloaded django-elasticsearch-dsl using the commands:
pip install https://github.com/sabricot/django-elasticsearch-dsl/archive/6.4.0.tar.gz
and
pip install django-elasticsearch-dsl, but they both caused the same results.
I don't believe this is a duplicate question because every other question I have read pertaining to this error has dealt with only the ElasticSearch library, not the django-elasticsearch-dsl library. The latter is built on top of the former, but I can't seem to find a elasticsearch.yml file as detailed in all other posts.
Here is what is installed in my virtual environment:
>> pip freeze
Django==2.2.2
django-elasticsearch-dsl==6.4.0
elasticsearch==7.0.2
elasticsearch-dsl==7.0.0
lazy-object-proxy==1.4.1
mccabe==0.6.1
pylint==2.3.1
python-dateutil==2.8.0
pytz==2019.1
requests==2.22.0
typed-ast==1.4.0
urllib3==1.25.3
According to this tutorial, the command http://127.0.0.1:9200 should return what looks like a JSON response, but instead I get the error:
curl: (7) Failed to connect to localhost port 9200: Connection refused
Have you made documents.py for each app? You need to make it to push the data to the elasticsearch database. But firstly you need to install elasticsearch properly(in your case its not installed properly).
Try this Tutorial for installing elasticsearch, i used it recently and it worked like a charm.
Link
And this is the path for elasticsearch.yml, (/etc/elasticsearch/elasticsearch.yml).
And dont forget to start it using - sudo systemctl start elasticsearch(check its status using - sudo systemctl status elasticsearch )

R interpreter not working in Zeppelin 0.6.2

I recently installed apache zeppelin 0.6.2 on Mac OS Siera 10.2, I am able to run the spark and python examples but when I try to run the R codes using either %r or %spark.r I get an error. I have already set the SPARK_HOME and SCALA_HOME in .bash_profile. Attaching the error log:
INFO [2016-10-31 19:48:10,806] ({pool-2-thread-5} SchedulerFactory.java[jobFinished]:137) - Job remoteInterpretJob_1477923480756 finished by scheduler org.apache.zeppelin.spark.SparkRInterpreter314730576
INFO [2016-10-31 19:48:10,804] ({pool-1-thread-5} ZeppelinR.java[createRScript]:366) - File /var/folders/_b/2cr99z410sddt8km9p9b9fs80000gn/T/zeppelin_sparkr-6402261059466053567.R created
ERROR [2016-10-31 19:48:20,836] ({pool-1-thread-5} TThreadPoolServer.java[run]:296) - Error occurred during processing of message.
org.apache.zeppelin.interpreter.InterpreterException: sparkr is not responding
Just figured out that setting SPARK_HOME in .bash_profile is not enough, one needs to also update the zeppelin-env.sh and set SPARK_HOME there as well.

Categories

Resources