I am starting mlflow with below command
mlflow server --static_prefix=/myprefix --backend-store-uri postgresql://psql_user_name:psql_password#localhost/mlflow_db --default-artifact-root s3://my-mlflow-bucket/ --host 0.0.0.0 -p 8000
everything worked fine and I can see mlflow UI when I open url http://localhost:8000/myprefix
but when I use mlflow.set_tracking_uri() i have to give url path as "http://localhost:8000/"
why cant we use full url , which has static prefix "http://localhost:8000/myprefix" ?
if i use full url ,I am getting request to api endpoint fail and api is experiments/list error 404 !=200
is there any way to add url with static prefix in set_tracking_uri
FYI it appears via https://github.com/mlflow/mlflow/issues/4484#issue-925407532 that this isn't supported. The --static-prefix flag only impacts the UI (e.g. all paths under /ajax-api/2.0) while the REST API is under /api and is not impacted by --static-prefix.
It looks like the way around this is to used some sort of load balancer / frontend that can do path rewrites (an example w/ nginx is given in that issue)
Related
I've an issue wit a redirect-middleware in traefik V2.
We want to add a trailing-slash to a sublocation and then remove
the path with a PathPrefix-Rule to get correct paths from the docker service. (MkDOCS)
We defined the rule in dynamic_conf.toml for traefik as a general middleware.:
[...]
[http.middlewares.add-trailing-slash.redirectregex]
regex= "(https?://[^/]+/[a-z0-9_]+)$$"
replacement= "$${1}/"
permanent = true
[...]
At the moment this is our label-file included with docker-run:
traefik.enable=true
traefik.http.routers.dockerservice.entryPoints=websecure
traefik.http.routers.dockerservice.rule=PathPrefix(`/dockerservice`)
traefik.http.routers.dockerservice.tls=true
traefik.http.middlewares.dockerservice-strip.stripprefix.prefixes=/dockerservice
traefik.http.routers.dockerservice.middlewares=add-trailing-slash#file,doc-strip
At https://regex101.com/ the rule seems to work fine for eg https://domain.tld/dockerservice
If the service is up and we navigate to https://domain.tld/dockerservice
it redirects to https://domain.tld/${1}/
The Variable is not expanded. Instead we get the 404-not found error (as expected because a service route with this name does not exists in our traefik setup)
So the trailing-slash is added as desired, but the dockerservice-capture is not expanded.
We've also tried this as a #docker rule on the label_file for the docker-run command but the "error" remains.
We also tried this which we found on the web first (as #file in dyanmic_conf or #docker as label-file for docker run):
traefik.http.middlewares.add-trailing-slash.chain.middlewares=strip-prefix-1,strip-prefix-2
traefik.http.middlewares.strip-prefix-1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$
traefik.http.middlewares.strip-prefix-1.redirectregex.replacement=$${1}/
traefik.http.middlewares.strip-prefix-1.redirectregex.permanent=true
traefik.http.middlewares.strip-prefix-2.stripprefixregex.regex=/[a-z0-9_]+
We where trying with ${0} and multiple other attempts where made using double quotes, and single quotes or $-signs.
Our toolchain is as follows:
pushing into the git-repo on the master branach
gitlab-runner executes a .sh file with docker build and docker run command
label-file is provided in the git-repo
We would like to have a generic redirect for all services which have this middleware added
to add a trailing slash if only one Path-Element is added and the trailing slash is missng
So
https://domain.tld/dockerservice should redirect to https://domain.tld/dockerservice/
a Request like https://domain.tld/dockerservice/page should not be changed because
of the strip in the mkdocs container only /page is needed.
At this point we tried a lot and we don't know why traefik is not expanding the variable.
Anyone knows what we are doing wrong?
Best wishes
Exa.Byte
I've finally found a solution which suits well for our purpose:
I just used one $ sign in conjunction with two for the regex option.
added in dynamic.toml for traefik itself:
[http.middlewares.add-trailing-slash.redirectRegex]
regex= "(https?://[^/]+/[a-z0-9_]+)$$"
replacement= "${1}/"
permanent = true
lg
exa.byte
I'm using eXist-db over docker container - installing Java over Ubuntu, installing the eXist installation headless jar, and also adding data Volume (Azure file) to store all the physical files and the db data files.
I need to upload automatically files to the eXist-db, after I generate a new file and save it to the volume drive (using C#).
According to the eXist documentation on uploading files there are several methods to upload files to eXist, but none of them work for me.
Dashboard or eXide - not relevant since these are GUI applications.
Java Admin Client - not working because have no GUI -> I'm getting this failure: 'No X11 DISPLAY variable was set, but this program performed an operation which requires it...'
Over REST or WebDAV via web client (using browser or by code), I can run XQuery for queries, but for storing new files, how?
So, the solution I found is to write an XQuery file, using the xmldb:store function.
This query saved the posted file using the specified name and location (in the volume), and the stored file can then be retrieved via REST or WebDAV.
But I feel that there must be a simpler solution...
Can anyone help?
BTW, here is the xmldb:store XQuery:
xquery version "3.1";
declare function local:upload() {
let $filename := request:get-uploaded-file-name("file")
let $log-in := xmldb:login("/db", "Admin", "admin")
let $file := "file:///usr/new_file_location.xml"
let $record := doc($file)
let $store := xmldb:store("/db/akn", "new_file_name.xml", $record)
return
<results>
<message>File {$file} has been stored.</message>
</results>
};
local:upload()
When starting eXist as described in the eXist Docker documentation - with it listening on port 8080 - you can access all of eXist's standard endpoints:
http://localhost:8080/exist/webdav/db for WebDAV
http://localhost:8080/exist/rest/db for REST
http://localhost:8080/exist/xmlrpc/db for XML-RPC
http://localhost:8080/exist/apps for apps installed in /db/apps.
Of course if you've configured Docker's eXist to listen on a different port, just switch the port.
Thus, to upload files to a Dockerized eXist programmatically, the methods outlined in the documentation article you referenced, Uploading files, should all work: WebDAV, client.sh, Ant, or even curl. For WebDAV, if you haven't configured users and passwords, you'd just connect with the URL http://localhost:8080/exist/webdav/db, username "admin", and a blank password. For Ant, see the Ant tasks documentation. For curl, you would perform an HTTP PUT request to the REST interface:
curl -s -f -H 'Content-Type: application/xml' \
-T <filename> \
--user <user>:<password> \
"http://localhost:8080/exist/rest/db/apps/<collection>/<filename>"
This is also possible:
echo put /home/files/<FILRPATH>/main.xml | /usr/local/eXist-db/
bin/client.sh -s
How do I configure the resource adapter and/or the vdb for a url that sits behind an F5? Suppose that my resource adapter and vdb are configured to read data from
https://foo.org/data?cat='pricing'&page=1&rows=20
If this is a direct hostname then Data Virt reads the data correctly. If it is an F5 then I get an ArrayIndexOutOfBoundsException because the InputStream size is zero.
I verified that the authentication configuration works correctly, so it's not authentication-related.
If I curl the above url (when behind F5) then I get a failed 302 and no results. If I curl -L then I get static html error page (generated apparently because the server did not receive the required parameters). If I curl -L -b cookies.txt then I get the expected data. So basically, my challenge it to apply the equivalent of curl -L and -b cookies.txt options to a Data Virt resource adapter and/or vdb.
The web services translator directly does not support 302 (redirection), however it uses CXF underneath to make the connections. So, configure cxf configuration file on web service as defined in examples here 1 look at Configuring Https, then add the redirect configuration to this file as described at 2
<http:client AutoRedirect="true" Connection="Keep-Alive"/>
http://teiid.github.io/teiid-documents/master/content/admin/Web_Service_Data_Sources.html
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html
When adding a URL into a web browser, I get the usual prompt to open the XML file and view it. However, when I use the same URL within a Curl batch file it only appears to download the login aspx page.
//stuff/stuff/Report.aspx?Report=All_Nodes_IP_Report&DataFormat=XML&AccountID=<UID>&Password=<password>
My batch file looks like this:
curl -L "//stuff/stuff/Report.aspx?Report=All_Nodes_IP_Report&DataFormat=XML&AccountID=<UID>&Password=<Password>" -o "local.xml" -v
pause
What am I doing wrong? There's no proxy server between me and the report URL..? The web site is https but I can't include that as the validation checker keeps moaning at me :)
why use CURL when you can use one application called MGET that i create.
Download Link:
http://bit.ly/1i1FpGE
Syntax of the command:
MGET //stuff/stuff/Report.aspx?Report=All_Nodes_IP_Report&DataFormat=XML&AccountID=<UID>&Password=<Password> local.xml
And if you want to use HTTPS do it, for best experience use HTTP
I can't understand why I am getting a http 500 response. When I run my uwsgi server from the path that my python script is defined in, everything is perfect. As soon as I run it from another path, I get a 500 response.
Here is my uwsgi script (I set the protocol to http just for testing purposes):
/home/baz/.virtualenvs/python-flask-benchmark/bin/uwsgi
--master
--socket 127.0.0.1:3031
--pythonpath "/home/baz/Personal/Github/benchmark-node_vs_python/python"
--file "/home/baz/Personal/Github/benchmark-node_vs_python/python/app.py"
--callable app
--processes 20
--virtualenv "/home/baz/.virtualenvs/python-flask-benchmark"
--enable-threads
--protocol http
Does anyone know why? It seems like it is ignoring the --pythonpath argument.
Okay, figured it out. It was a path error whereby my application could not find a file to open. The problem was that this was not logged to Uwsgi, which was just silent. The reason was because this was a flask application, which needs to be instructed to pass all exception errors to uwsgi by doing this: app.config['PROPAGATE_EXCEPTIONS'] = True