Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baris/eng 293 remove git init #293

Merged
merged 10 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ pip install git+https://github.com/zenml-io/zenml.git@main --upgrade

The quickest way to get started is to create a simple pipeline.

#### Step 1: Initialize a ZenML repo from within a git repo
#### Step 1: Initialize a ZenML repo

```bash
git init
zenml init
zenml integration install sklearn # we use scikit-learn for this example
```
Expand Down
1 change: 0 additions & 1 deletion docs/book/guides/class-based-api/class-based-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ zenml example pull class_based_api
cd zenml_examples/class_based_api

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion docs/book/guides/functional-api/functional-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ zenml example pull functional_api
cd zenml_examples/functional_api

# initialize
git init
zenml init
```

Expand Down
16 changes: 3 additions & 13 deletions docs/book/introduction/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,15 @@ description: A good place to start before diving further into the docs.

**Repository**

A repository is at the core of all ZenML activity. Every action that can be executed within ZenML must take place
within a ZenML repository. ZenML repositories are inextricably tied to `git`. ZenML creates a `.zen` folder at the
root of your repository to manage your assets and metadata.
Every ZenML project starts inside a ZenML repository and, it is at the core of all ZenML activity. Every action that
can be executed within ZenML must take place within such a repository.

Every ZenML project starts inside a ZenML repository. Think of it just like a normal Git repository, except that
there are some added bonuses on top! A repository is at the core of all ZenML activity. Every action that can be
executed within ZenML must take place within a ZenML repository. ZenML repositories are inextricably tied to `git`.
ZenML creates a `.zen` folder at the root of your repository to manage your assets and metadata.

To create a ZenML repository, do the following after having installed ZenML:
In order to create a ZenML repository, do the following after having installed ZenML:

```
zenml init
```

{% hint style="warning" %}
Please make sure to be inside a valid git repository before executing the above!
{% endhint %}

The initialization creates a local `.zen` folder where various information about your local configuration lives,
e.g., the active [Stack](guides/deploy\_to\_production.md) that you are using to run pipelines.

Expand Down
3 changes: 0 additions & 3 deletions docs/book/introduction/quickstart-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Once the installation is completed, you can go ahead and create your first ZenML
ZenML repositories are built on top of Git repositories, you can create yours in a desired empty directory through:

```python
# Initialize a git repository
git init

# Initialize ZenML
zenml init
```
Expand Down
1 change: 0 additions & 1 deletion examples/airflow_local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ zenml example pull airflow_local
cd zenml_examples/airflow_local

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/caching/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ zenml example pull caching
cd zenml_examples/caching

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/dag_visualizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ zenml example pull dag_visualizer
cd zenml_examples/dag_visualizer

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/functional_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ zenml example pull functional_api
cd zenml_examples/functional_api

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/kubeflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ zenml example pull kubeflow
cd zenml_examples/kubeflow

# Initialize a ZenML repository
git init
zenml init
```

Expand Down
8 changes: 2 additions & 6 deletions examples/kubeflow/ZenML Walkthrough Kubeflow Pipelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@
},
"outputs": [],
"source": [
"# Initialize a git repository\n",
"!git init\n",
"\n",
"# Initialize ZenML's .zen file\n",
"# Initialize a ZenML repository\n",
"!zenml init"
]
},
Expand Down Expand Up @@ -101,7 +98,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -862,4 +858,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
1 change: 0 additions & 1 deletion examples/lineage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ zenml example pull lineage
cd zenml_examples/lineage

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/not_so_quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ zenml example pull not_so_quickstart
cd zenml_examples/not_so_quickstart

# initialize
git init
zenml init
```

Expand Down
1 change: 0 additions & 1 deletion examples/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ zenml example pull quickstart
cd zenml_examples/quickstart

# initialize
git init
zenml init
```

Expand Down
9 changes: 3 additions & 6 deletions examples/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@
},
"outputs": [],
"source": [
"# Initialize a git repository\n",
"!git init\n",
"\n",
"# Initialize ZenML's .zen file\n",
"# Initialize a ZenML repository\n",
"!zenml init"
]
},
Expand Down Expand Up @@ -640,7 +637,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -654,7 +651,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
2 changes: 0 additions & 2 deletions examples/run_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ main() {
python3 -m pip install -r requirements.txt
fi

git init

zenml_init

if [ -f "setup.sh" ]; then
Expand Down
1 change: 0 additions & 1 deletion examples/statistics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ zenml example pull statistics
cd zenml_examples/statistics

# initialize
git init
zenml init
```

Expand Down
22 changes: 7 additions & 15 deletions src/zenml/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@
Beginning a Project
-------------------

When you begin a project, you should first initialize your base project
directory as a Git repository. To do this, type:

.. code:: bash

git init

Once your directory is setup with a (usually hidden) ``.git`` folder,
initialize the directory with ZenML’s own config and resource management
tools. Type:
In order to start working on your project, initialize a ZenML repository
within your current directory with ZenML’s own config and resource management
tools:

.. code:: bash

Expand All @@ -70,11 +63,10 @@
This is all you need to begin using all the MLOps goodness that ZenML
provides!

If your repository is not initialized as a ``git`` repository, the CLI
will let you know with an error message. By default, ``zenml init`` will
install its own hidden ``.zen`` folder inside the current directory from
which you are running the command. You can also pass in a directory path
manually using the ``--repo_path`` option:
By default, ``zenml init`` will install its own hidden ``.zen`` folder
inside the current directory from which you are running the command.
You can also pass in a directory path manually using the
``--repo_path`` option:

.. code:: bash

Expand Down
3 changes: 1 addition & 2 deletions src/zenml/cli/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def init(
repo_path: Path to the repository.

Raises:
InvalidGitRepositoryError: If repo is not a git repo.
AssertionError
InitializationException: If the repo is already initialized.
"""
if sys.version_info.minor == 6:
warning(
Expand Down
11 changes: 7 additions & 4 deletions src/zenml/integrations/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import pkg_resources

from zenml.exceptions import DoesNotExistException
from zenml.integrations.registry import integration_registry
from zenml.logger import get_logger

Expand Down Expand Up @@ -50,13 +49,17 @@ class Integration(metaclass=IntegrationMeta):
def check_installation(cls) -> bool:
"""Method to check whether the required packages are installed"""
try:
for req, command in cls.SYSTEM_REQUIREMENTS.items():
for requirement, command in cls.SYSTEM_REQUIREMENTS.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @schustmi already has a branch for this :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I merged @schustmi 's branch before the request so it should be good to go.

result = shutil.which(command)

if result is None:
raise DoesNotExistException(
f"Unable to find the required packages for {req} on your system. Please install the packages on your system and try again."
logger.debug(
"Unable to find the required packages for %s on your "
"system. Please install the packages on your system "
"and try again.",
requirement,
)
return False

for r in cls.REQUIREMENTS:
pkg_resources.get_distribution(r)
Expand Down