Skip to content

Commit

Permalink
Updates docs URL slugs in Prefect source code for 3.0 GA (#15224)
Browse files Browse the repository at this point in the history
  • Loading branch information
discdiver authored Sep 4, 2024
1 parent 1f9bed1 commit 0f0aa85
Show file tree
Hide file tree
Showing 33 changed files with 68 additions and 2,318 deletions.
4 changes: 4 additions & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,10 @@
"destination": "/3.0/api-ref/python",
"source": "/latest/api-ref/prefect/:slug*"
},
{
"destination": "/3.0/api-ref/python",
"source": "/api-ref/prefect/:slug*"
},
{
"source": "/3.0rc/:slug*",
"destination": "/3.0/:slug*"
Expand Down
16 changes: 12 additions & 4 deletions src/integrations/prefect-azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ pip install prefect-azure
```

To use Blob Storage:

```bash
pip install "prefect-azure[blob_storage]"
```

To use Cosmos DB:

```bash
pip install "prefect-azure[cosmos_db]"
```

To use ML Datastore:

```bash
pip install "prefect-azure[ml_datastore]"
```
Expand Down Expand Up @@ -61,6 +64,7 @@ example_blob_storage_download_flow()
```

Use `with_options` to customize options on any existing task or flow:

```python
custom_blob_storage_download_flow = example_blob_storage_download_flow.with_options(
name="My custom task name",
Expand Down Expand Up @@ -121,25 +125,29 @@ container_instance_job.save("aci-dev")
```

Then, create the deployment either on the UI or through the CLI:

```bash
prefect deployment build a_flow_module.py:log_hello_flow --name aci-dev -ib container-instance-job/aci-dev
```

Visit [Prefect Deployments](https://docs.prefect.io/tutorials/deployments/) for more information about deployments.
Visit [Prefect Deployments](https://docs.prefect.io/latest/deploy/) for more information about deployments.

## Azure Container Instance Worker
The Azure Container Instance worker is an excellent way to run
your workflows on Azure.

The Azure Container Instance worker is an excellent way to run
your workflows on Azure.

To get started, create an Azure Container Instances typed work pool:

```
prefect work-pool create -t azure-container-instance my-aci-work-pool
```

Then, run a worker that pulls jobs from the work pool:

```
prefect worker start -n my-aci-worker -p my-aci-work-pool
```

The worker should automatically read the work pool's type and start an
The worker should automatically read the work pool's type and start an
Azure Container Instance worker.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
!!! note
Azure Storage account needs to have Hierarchical Namespace disabled.
For more information about using deployment steps, check out out the Prefect [docs](https://docs.prefect.io/latest/concepts/projects/#the-prefect-yaml-file).
For more information about using deployment steps, check out out the Prefect [docs](https://docs.prefect.io/latest/deploy/).
""" # noqa

from pathlib import Path, PurePosixPath
Expand Down
140 changes: 1 addition & 139 deletions src/integrations/prefect-bitbucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,142 +7,4 @@
<img src="https://img.shields.io/pypi/dm/prefect-bitbucket?color=0052FF&labelColor=090422" /></a>
</p>


## Welcome!

Prefect integrations for working with Bitbucket repositories.

## Getting Started

### Python setup

Requires an installation of Python 3.9+.

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).

### Installation

Install `prefect-bitbucket` with `pip`:

```bash
pip install prefect-bitbucket
```

Then, register to [view the block](https://docs.prefect.io/ui/blocks/) on Prefect Cloud:

```bash
prefect block register -m prefect_bitbucket
```

Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://docs.prefect.io/ui/blocks/).

### Write and run a flow
#### Load a pre-existing BitBucketCredentials block

```python
from prefect import flow
from prefect_bitbucket.credentials import BitBucketCredentials

@flow
def use_stored_bitbucket_creds_flow():
bitbucket_credentials_block = BitBucketCredentials.load("BLOCK_NAME")

return bitbucket_credentials_block

use_stored_bitbucket_creds_flow()
```

#### Create a new BitBucketCredentials block in a flow

```python
from prefect import flow
from prefect_bitbucket.credentials import BitBucketCredentials

@flow
def create_new_bitbucket_creds_flow():
bitbucket_credentials_block = BitBucketCredentials(
token="my-token",
username="my-username"
)

create_new_bitbucket_creds_flow()
```

#### Create a BitBucketRepository block for a public repo
```python
from prefect_bitbucket import BitBucketRepository

public_repo = "https://bitbucket.org/my-workspace/my-repository.git"

# Creates a public BitBucket repository BitBucketRepository block
public_bitbucket_block = BitBucketRepository(
repository=public_repo
)

# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
public_bitbucket_block.save("my-bitbucket-block")
```

#### Create a BitBucketRepository block for a public repo at a specific branch or tag
```python
from prefect_bitbucket import BitBucketRepository

public_repo = "https://bitbucket.org/my-workspace/my-repository.git"

# Creates a public BitBucket repository BitBucketRepository block
branch_bitbucket_block = BitBucketRepository(
reference="my-branch-or-tag", # e.g "master"
repository=public_repo
)

# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
branch_bitbucket_block.save("my-bitbucket-branch-block")
```
#### Create a new BitBucketCredentials block and a BitBucketRepository block for a private repo
```python
from prefect_bitbucket import BitBucketCredentials, BitBucketRepository

# For a private repo, we need credentials to access it
bitbucket_credentials_block = BitBucketCredentials(
token="my-token",
username="my-username" # optional
)

# Saves the BitBucketCredentials block to your Prefect workspace (in the Blocks tab)
bitbucket_credentials_block.save(name="my-bitbucket-credentials-block")


# Creates a private BitBucket repository BitBucketRepository block
private_repo = "https://bitbucket.org/my-workspace/my-repository.git"
private_bitbucket_block = BitBucketRepository(
repository=private_repo,
bitbucket_credentials=bitbucket_credentials_block
)

# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
private_bitbucket_block.save(name="my-private-bitbucket-block")
```

#### Use a preexisting BitBucketCredentials block to create a BitBucketRepository block for a private repo
```python
from prefect_bitbucket import BitBucketCredentials, BitBucketRepository

# Loads a preexisting BitBucketCredentials block
BitBucketCredentials.load("my-bitbucket-credentials-block")

# Creates a private BitBucket repository BitBucketRepository block
private_repo = "https://bitbucket.org/my-workspace/my-repository.git"
private_bitbucket_block = BitBucketRepository(
repository=private_repo,
bitbucket_credentials=bitbucket_credentials_block
)

# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
private_bitbucket_block.save(name="my-private-bitbucket-block")
```

!!! info "Differences between Bitbucket Server and Bitbucket Cloud"

For Bitbucket Cloud, only set the `token` to authenticate. For Bitbucket Server, set both the `token` and the `username`.
See the docs at [https://docs.prefect.io/integrations/prefect-bitbucket](https://docs.prefect.io) for more information.
Loading

0 comments on commit 0f0aa85

Please sign in to comment.