Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Release 0.3.0 #397

Merged
merged 21 commits into from
Oct 27, 2022
Merged

Release 0.3.0 #397

merged 21 commits into from
Oct 27, 2022

Conversation

mike0sv
Copy link
Contributor

@mike0sv mike0sv commented Sep 8, 2022

This is a list of activities that should be done before release announce

First, things before release

Breaking changes - merge in this PR

  • New deployment state management
  • New CLI interface: breaking changes in serve, apply-remote, build and declare

Other changes - merge in this PR

Docs

Blog post

Example-repo - PR in example-repos-dev

  • update example-mlem-get-started

Update the website code animations

Second, the release itself

MLEM Release

Third, things after release

* Add -c help to declare WIP

* extrapolate for other commands

* some field docs and little improvements

* cli utils

* add simple_parsing

* fix tests

* fix tests

* lazy help

* ooopsie

* class and fields docstrings

* reparsing cli params for nested complex objects
rewrite get_field_docstring for 9000x speed
fix build_model bug

* fix for py37

* support lists in build_model

* support lists in cli

* nested options WIP

* very nested options WIP

* all but flat nested WIP

* lil refactoring

* flat nested stuff DONE

* Update mlem/contrib/heroku/build.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/cli/declare.py

Co-authored-by: Alexander Guschin <[email protected]>

* get rid of --conf, add mlem abc to declare

* fix tests

* fix lazyness

* fix serialization

* fix tests

* fix tests

* Update bitbucketfs.py

* Apply suggestions from code review

* fix comments and disable failfast for gh actions

* backport docs from mlem.ai

* sort import choices

* make run_cmd optional instead of bool

* docs for torch import

* allow --load for groups
add server config into docker build

* fix windows bugs

* suddenly fix dockerhub requests

* suddenly fix dockerhub requests

Co-authored-by: Alexander Guschin <[email protected]>
@mike0sv mike0sv requested a review from a team September 8, 2022 22:54
@mike0sv mike0sv self-assigned this Sep 8, 2022
@mike0sv mike0sv temporarily deployed to internal September 8, 2022 22:54 Inactive
@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Base: 89.49% // Head: 87.02% // Decreases project coverage by -2.46% ⚠️

Coverage data is based on head (7533408) compared to base (86105ee).
Patch coverage: 77.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
- Coverage   89.49%   87.02%   -2.47%     
==========================================
  Files          81       96      +15     
  Lines        6413     7909    +1496     
==========================================
+ Hits         5739     6883    +1144     
- Misses        674     1026     +352     
Impacted Files Coverage Δ
mlem/api/__init__.py 100.00% <ø> (ø)
mlem/cli/clone.py 100.00% <ø> (ø)
mlem/cli/dev.py 50.00% <ø> (ø)
mlem/cli/import_object.py 100.00% <ø> (ø)
mlem/cli/link.py 100.00% <ø> (ø)
mlem/contrib/callable.py 98.26% <ø> (ø)
mlem/contrib/docker/__init__.py 100.00% <ø> (ø)
mlem/contrib/dvc.py 60.29% <ø> (ø)
mlem/contrib/fastapi.py 95.38% <ø> (ø)
mlem/contrib/numpy.py 98.34% <ø> (ø)
... and 81 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

* new state POC

* update docker and mock deployments

* add locks

* simplify deployment meta (by complexifying code)

* fix tests

* fix tests

* fix tests

* fix win tests

* default env and server

* fsspec manager as default

* Sagemaker deployments (#366)

* WIP

* its alive (kinda)

* it works but it's ugly

* little less ugly

* lil fix

* fix lint

* fix lint

* fix tests

* fix tests

* fix windows bugs

* fix tests

* fix tests

* fix for dirs deployment state

* create MlemSource to choose how mlem is added to docker

* test that all configs in entrypoints

* better cli val error

* better docker package install

* finish merge

* fix short tests

* fix short tests

* Update mlem/contrib/sagemaker/runtime.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/core/objects.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/core/objects.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/contrib/docker/base.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/contrib/docker/base.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/contrib/docker/base.py

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/contrib/heroku/meta.py

Co-authored-by: Alexander Guschin <[email protected]>

* Apply suggestions from code review

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/contrib/sagemaker/build.py

Co-authored-by: Alexander Guschin <[email protected]>

Co-authored-by: Alexander Guschin <[email protected]>
@mike0sv mike0sv temporarily deployed to internal September 14, 2022 10:22 Inactive
* fix tests

* Sagemaker deployments (#366)

* WIP

* its alive (kinda)

* it works but it's ugly

* little less ugly

* lil fix

* fix lint

* fix lint

* fix tests

* fix tests

* fix windows bugs

* fix tests

* fix tests

* test that all configs in entrypoints

* fix short tests

* wip kubernetes support

* use APIs to deploy and get status, deletion still pending

* remove get client from state

* fix param

* fix jinja template

* working remove and status

* fix client

* small fixes

* attempt to add tests

* setup github actions for k8s tests

* fix linter

* use predict method of client

* allow registry to be configurable by cli

* change calculation of host and port according to service type

* re-enable k8s test as new workflow

* fix daemon access in tests

* make linter happy

* fix fixtures

* suggested fixes and refactor

* make namespace as a separate field and use enums

* use watcher to figure out when resources are deleted

* check minikube status before loading kubeconfig in fixture

* minor suggestions

* use enums for comparisons as well

* create abstract class for services for host and port info

* raise error when service of type clusterIP

* fix build and use tag as model hash

* fix echo message

* hot swapping of docker image deployed

* remove unnecessary f-string

* skip swapping when same hash is tried to be deployed again

* suggested improvements

* fix lint

* fix pylint

* suggested improvements

* fix pylint

* update entrypoints

* add docstrings for K8sYamlBuildArgs

* add docstrings for k8s service type classes

* capitalize docstrings for fields

* remove service type enum

* Remove new workflow for K8s

* remove duplicate methods

* remove version from iterative-telemetry

Co-authored-by: mike0sv <[email protected]>
@mike0sv mike0sv temporarily deployed to internal September 15, 2022 07:43 Inactive
* Fix docstrings

* comments from mlem.ai PR

* ignore mocks

* fix tests and update metavars

* dot

* feedback

* no dots

* add exts tests

* fix field doc

* fix declare list and tests

* no typed links in mlem list

* MLEM model and MLEM dataset

* 💅🏼
@mike0sv mike0sv temporarily deployed to internal September 19, 2022 14:59 Inactive
# Conflicts:
#	mlem/cli/main.py
#	tests/cli/test_deployment.py
#	tests/cli/test_serve.py
@mike0sv mike0sv temporarily deployed to internal September 19, 2022 15:18 Inactive
@aguschin aguschin temporarily deployed to internal October 5, 2022 04:44 Inactive
* initial draft

* almost

* fixing things

* fix bug

* fix links in config get/set

* mark test as long

* remove newline characters, add help to mlemmixin

* fix linting

* fix some tests

* mark test as xfail

* fix issues with pandas pylint and flake8 (#427)

* fix issues with pandas pylint and flake8

* fix requirements

* fix req tests

* remove comment

* fix catboost req tests

Co-authored-by: mike0sv <[email protected]>

Co-authored-by: mike0sv <[email protected]>
Co-authored-by: Madhur Tandon <[email protected]>
@aguschin aguschin temporarily deployed to internal October 5, 2022 04:59 Inactive
* refactoring of deployments and env - move logic to deployments, remove model field

* adjust deployments cli

* add rev to deploy API

* fix tests and pylint

* add deployment declaration and model link to state

* fix lint

* fix tests

* fix tests

* fix tests

* add debug env

* fix crash on missing deps

* linting

* fix issues with pandas pylint and flake8

* fix requirements

* fix req tests

* remove comment

* fix docker tests

* fix catboost req tests

* fix issues with pandas pylint and flake8 (#427)

* fix issues with pandas pylint and flake8

* fix requirements

* fix req tests

* remove comment

* fix catboost req tests

Co-authored-by: mike0sv <[email protected]>

* fix k8s tests

* fix k8s tests

* fix windows bugs

* fix sagemaker circular import

* fix configs

* Apply suggestions from code review

Co-authored-by: Alexander Guschin <[email protected]>

* Update mlem/cli/deployment.py

Co-authored-by: Alexander Guschin <[email protected]>

Co-authored-by: Madhur Tandon <[email protected]>
Co-authored-by: Madhur Tandon <[email protected]>
Co-authored-by: Alexander Guschin <[email protected]>
@mike0sv mike0sv temporarily deployed to internal October 5, 2022 12:23 Inactive
cls=mlem_group("runtime", aliases=["deploy"]),
)
app.add_typer(deployment)

deploy_run = Typer(
Copy link
Contributor

@aguschin aguschin Oct 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Using thread to keep comments under control, this is unrelated to a specific line highlighed)
Can't build docker image with this branch:

$ mlem declare env docker --registry local --daemon.host localhost docker-builder.mlem
$ mlem build docker --file_conf docker-builder --model rf.mlem --image.name=rf-docker
not enough values to unpack (expected 2, got 1)

What's wrong? @mike0sv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, it's --file_conf here, but it's --load in $ mlem deployment run --load ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use mlem build --load, not mlem build docker --file_conf. I will check the bug though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--file_conf is in $ mlem build docker -h for me. Don't see --load there.

Copy link
Contributor

@aguschin aguschin Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got you. mlem build --load, not mlem build docker --load. Do we need --file_conf though? It can be confusing, just like it was for me (I know I need to be more careful reading details, but so do other people as well :)

Copy link
Contributor

@aguschin aguschin Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was that I used env instead of builder. It works like this:

$ mlem declare builder docker docker-builder.mlem --image.name rf-docker --env.daemon.host "" --server fastapi
$ mlem build --load docker-builder.mlem --model models/rf

Few items:

  • --env.daemon.host should be marked as required - running declare fails without it
  • --server should be marked as required arg, since build fails if it wasn't specified in builder declaration
  • We could improve the error I mentioned in the 1st message (not enough values to unpack (expected 2, got 1)) and print something like File provided to file_conf must have lines of form "arg=value"
  • (UPD) let's rename --file_conf option to --load (mlem build docker -h)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this wasn't fixed by your last PR @mike0sv. This is not that urgent though. @madhur-tandon, could you please TAL and fix what I've reported in the last message above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I am able to run mlem declare builder docker lold.mlem --image.name lold without passing --env.daemon.host so it is not mandatory. Looks like a local issue again on your side. Same for --server, it is NOT required for build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @madhur-tandon, indeed, those were issues with my installation. Could you please fix the last 2 items? They still appear for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created an issue so we won't forgot addressing it later #441

@mike0sv mike0sv temporarily deployed to internal October 5, 2022 17:22 Inactive
@mike0sv mike0sv temporarily deployed to internal October 5, 2022 18:33 Inactive
* Fix docstrings

* comments from mlem.ai PR

* ignore mocks

* fix tests and update metavars

* dot

* feedback

* no dots

* add exts tests

* Add docstrings to extensions

Co-authored-by: Alexander Guschin <[email protected]>
@mike0sv mike0sv temporarily deployed to internal October 6, 2022 12:59 Inactive
* get rid of mlem dir

* fix tests

* fix bitbucket

* fix gitlab

* fix other tests

* fix bb tests
@aguschin aguschin temporarily deployed to internal October 12, 2022 08:54 Inactive
.pylintrc Show resolved Hide resolved
@aguschin
Copy link
Contributor

@madhur-tandon, btw this branch have few issues I've reported - they prevent me from finishing GS for build and deploy in new docs PR. If you could fix them, that would be awesome!

@aguschin aguschin temporarily deployed to internal October 17, 2022 04:27 Inactive
@aguschin aguschin mentioned this pull request Oct 17, 2022
@aguschin aguschin temporarily deployed to internal October 20, 2022 10:55 Inactive
* fixing docstrings to re-generate API docs

* fix newline
@aguschin aguschin temporarily deployed to internal October 20, 2022 11:34 Inactive
* add bandit to pre-commit & bump hooks

* fix bandit vulnerabilities

* refactor: remove key `usedforsecurity`, because not all version pylint support

* fix: try for `autoescape` into `jinja2.Environment

* style: apply

* confidense -> confidence
@aguschin aguschin temporarily deployed to internal October 22, 2022 14:44 Inactive
* add requirements builder

* add builder for virtualenv

* fix linting

* fix pylint again

* fix entrypoints

* remove upgrade deps

* add ability to install in current active venv

* fix pylint

* add ability to create conda based envs

* fix import

* fix has_conda check

* fix windows issues

* relax array comparison test

* fix typo

* use conda in github actions

* suggested improvements

* fix python version determination

* make create_virtual_env consistent

* suggested improvements

* add test for unix based req

* pass sample data

* fix test

* minor improvements

* use load_impl_ext for requirements builder

* fix tests

* add test for invalid req_type

* register conda mark in pytest

* add test for current and active venv

* fix tests

* fix test

* add conda reqs as list for the builder

* remove usage of context and protected access

* fix entrypoints

* remove pylint disable

* move CondaPackageRequirement to mlem.contrib.venv

* use materialize

* fix tests

* fix docstrings

* fix tests

* fix docs based test

* suggested changes
@madhur-tandon madhur-tandon temporarily deployed to internal October 25, 2022 10:37 Inactive
@aguschin aguschin temporarily deployed to internal October 27, 2022 10:54 Inactive
* Add quiet mode option

* add help

Co-authored-by: Alexander Guschin <[email protected]>
@aguschin aguschin temporarily deployed to internal October 27, 2022 12:06 Inactive
@aguschin aguschin temporarily deployed to internal October 27, 2022 12:23 Inactive
@madhur-tandon madhur-tandon temporarily deployed to internal October 27, 2022 12:59 Inactive
@madhur-tandon madhur-tandon temporarily deployed to internal October 27, 2022 13:23 Inactive
Copy link
Contributor

@aguschin aguschin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE! Congrats everyone! @mike0sv @madhur-tandon 🚀 this is an awesome step in the direction of the awesomeness!

@aguschin aguschin merged commit 663862f into main Oct 27, 2022
@aguschin aguschin deleted the release/0.3.0 branch October 27, 2022 16:38
@aguschin aguschin self-assigned this Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants