Tags: Be-Secure/mlem
Tags
Support IsolationForest (iterative#693) close iterative/mlem.ai#353 See also iterative#423 (comment)
Expose `params` passed to `mlem.api.save` to fastapi's `interface.jso… …n` (iterative#670) close iterative#664
Fix prometheus instrumentator (iterative#651) Co-authored-by: mike0sv <mike0sv@gmail.com>
Allow to set ENV vars for `build docker` and `deploy kubernetes` (ite… …rative#648) this is for iterative#647 (comment) This work similarly to iterative#645: `mlem build docker` works the same, but I'll provide an example for k8s deploy here: ``` $ mlem declare deployment kubernetes deployer \ --image_name myimage --service_type loadbalancer --registry remote \ --env docker --env.registry remote --registry.host localhost --namespace myns \ --set_env.0 VAR1 --set_env.1 VAR2=aguschin 💾 Saving deployment to deployer.mlem ``` ```yaml # deployer.mlem env: object_type: env registry: type: remote type: kubernetes image_name: myimage namespace: myns object_type: deployment registry: host: localhost type: remote service_type: type: loadbalancer set_env: - VAR1 - VAR2=aguschin type: kubernetes ``` Then in Dockerfile for your image you'll get: ``` ... ENV VAR1=VALUE1 ENV VAR2=aguschin ``` `VALUE1` will be taken from shell/env vars with `os.getenv("VAR1")`. If it's not set, an Exception will be raised by MLEM.
Add middlewares and one specific to expose `/metrics` endpoint for pr… …ometheus (iterative#629) did this in spare time instead of iterative#591 using https://github.com/trallnag/prometheus-fastapi-instrumentator these middlewares can be enabled via CLI if referenced by their `type` ClassVar: ``` $ mlem --tb serve fastapi --model ../emoji/lyrics2emoji --middlewares.0 prometheus_fastapi ``` --------- Co-authored-by: mike0sv <mike0sv@gmail.com>
Resolve requirements installed from Git or local source (iterative#645) For a package installed with `pip install git+https://...` this will pin down the URL to the package to be installed from Git. For a package installed with `pip install local/path` this will collect the package and add it as base64-encoded string to `.mlem` file. PR also adds `--build_arg` option for Docker builder to pass args at building time. TODO: - [ ] check that nothing breaks because of new fields in `requirements: ` (e.g. `source_url`) For k8s deployment this works like: ```sh $ mlem declare deployment kubernetes deployer \ --image_name myimage --service_type loadbalancer --registry remote \ --env docker --env.registry remote --registry.host localhost --namespace myns \ --build_arg.0 GITHUB_TOKEN --build_arg.1 GITHUB_USERNAME=aguschin 💾 Saving deployment to deployer.mlem ``` Note that one ARG value is set, another isn't: ```yaml $ cat deployer.mlem build_arg: - GITHUB_TOKEN - GITHUB_USERNAME=aguschin env: object_type: env registry: type: remote type: kubernetes image_name: myimage namespace: myns object_type: deployment registry: host: localhost type: remote service_type: type: loadbalancer type: kubernetes ``` Now at `mlem deploy --load deployer.mlem` MLEM will use `GITHUB_TOKEN` env var if set. If var has a different name, this can be run like ```sh $ GITHUB_TOKEN=$ENV_VAR_TO_USE mlem deploy --load deployer.mlem ``` Env var takes precedence, so if you set `GITHUB_USERNAME`, it's value will be used instead of `aguschin`.
Add server field to heroku deploy (iterative#631) closes iterative#568 Heroku requires you to use `PORT` env to expose a port. I changed `HerokuServer` to wrap arbitrary server (instead of subclassing `FastAPIServer`) and swap port for value from env. For that it needs to know which value is to swap, so I added `port_field` classvar to servers. --------- Co-authored-by: Alexander Guschin <1aguschin@gmail.com>
Read MLEM metafiles with `description` and `labels` (iterative#630) We deprecated them a while but were able to read them still, but not so long ago a change in MLEM made these files unreadable. Some repos still have those, such as https://github.com/iterative/demo-bank-customer-churn, which is needed to be read in Studio now. Besides, I'm switching `try_migrations=True` to automatically try to read and fix old metafile formats. @mike0sv, you initially set it to `False` - did you have any specific concerns in mind for that? cc @amritghimire @jellebouwman - once this is merged and released we need to check if the MLEM models in the repo can be read without any troubles. I'll ask your help with that @amritghimire
Fix declaring classes with abc fields with defaults (iterative#625)
PreviousNext