Skip to content

Commit

Permalink
remove references to in-repo bazel examples
Browse files Browse the repository at this point in the history
  • Loading branch information
augray committed Jan 8, 2025
1 parent ac7b502 commit ff40ec7
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 128 deletions.
36 changes: 2 additions & 34 deletions docs/contribute-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,44 +56,12 @@ to
from sematic.examples.my_package.pipeline import pipeline
```

### Integrate in the build system.

The Sematic codebase uses [Bazel](https://bazel.build/) as a build system.

Don't worry, you don't have to learn its details. Simply add a `BUILD` file at
the root of your package:

```
# sematic/examples/my_package/BUILD
sematic_example(
name = "my_package",
requirements = [
# List of third-party requirements
# e.g. "torch", "pandas"
],
data = [
# If your example uses local data files (e.g. CSV files)
# Add a relative path to them here.
]
)
```

Then you should be able to run (after [installing Bazel](https://bazel.build/install)):

```shell
$ bazel run //sematic/examples/my_package
```

### Third-party requirements

As a monorepo, Sematic keeps a centralized list of third-party requirements at
[requirements/requirements.in](https://github.com/sematic-ai/sematic/blob/main/requirements/requirements.in).
Sematic keeps a centralized list of third-party requirements in its pyproject.toml

If the third-party libraries required by your new examples are not in there
(Bazel will let you know), add them to
[requirements/requirements.in](https://github.com/sematic-ai/sematic/blob/main/requirements/requirements.in),
under the `# Examples` section.
, add them under the `examples` optional dependencies.

Don't worry, your third-party dependencies will not be added to the Sematic pip wheel.

Expand Down
4 changes: 2 additions & 2 deletions sematic/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ You can run these examples using the Sematic CLI:
$ sematic run examples/add
```

Examples are shorthand simple pipelines declared using the `sematic_pipeline`
Bazel rule, which expects a `__main__.py` file as the execution entry point.
Examples are shorthand simple pipelines
which expect a `__main__.py` file as the execution entry point.
They can only be executed locally. For cloud execution, you will need to
declare your own entry points which invoke execution using `CloudRunner`.

Expand Down
Empty file removed sematic/examples/bazel/__init__.py
Empty file.
22 changes: 0 additions & 22 deletions sematic/examples/bazel/bazel.py

This file was deleted.

33 changes: 0 additions & 33 deletions sematic/examples/bazel/pipeline.py

This file was deleted.

11 changes: 0 additions & 11 deletions sematic/examples/cifar_classifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ context.

## Running

### Bazel

After updating [BUILD](./BUILD) with your own registry and repository, you can
launch the pipeline with:

```bash
$ bazel run sematic/examples/cifar_classifier:main -- --cloud
```

### Native Docker

After updating [main.yaml](./main.yaml) with your own registry and repository,
you can launch the pipeline with:

Expand Down
4 changes: 0 additions & 4 deletions sematic/examples/hackernews_summarization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Arguments

Example usage:

```shell
$ bazel run sematic/examples/hackernews_summarization:hackernews_summarization -- --query llm --openai-api-key '<API_KEY>'
```

```shell
$ sematic run examples/hackernews_summarization --query llm --openai-api-key '<API_KET>'
```
Expand Down
11 changes: 0 additions & 11 deletions sematic/examples/lightning_resnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ mid-execution from a programming error. See [`test_pipeline.py`](./tests/test_pi

## Running

### Bazel

After updating [BUILD](./BUILD) with your own registry and repository, you can
launch the pipeline with:

```bash
$ bazel run sematic/examples/lightning_resnet:main -- --cloud
```

### Native Docker

After updating [main.yaml](./main.yaml) with your own registry and repository,
you can launch the pipeline with:

Expand Down
11 changes: 0 additions & 11 deletions sematic/examples/testing_pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ reduced.

## Running

### Bazel

After updating [BUILD](./BUILD) with your own registry and repository, you can
launch the pipeline with:

```bash
$ bazel run sematic/examples/testing_pipeline:__main__ -- --cloud
```

### Native Docker

After updating [main.yaml](./__main__.yaml) with your own registry and repository,
you can launch the pipeline with:

Expand Down

0 comments on commit ff40ec7

Please sign in to comment.