Skip to content

Commit

Permalink
Robusta api project (#1449)
Browse files Browse the repository at this point in the history
* using the robusta-api project for playbook building and removing robusta-cli build

This does not remove the old cli code - it will in another pr

* changed example

* changed to arik as author of robusta-api

* fixing missing pygal dependency

* manually installing robusta-cli for tests

* fixing robusta api version to 0.0.0
  • Loading branch information
Sheeproid authored Jun 9, 2024
1 parent b4b4200 commit 7531522
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 73 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,3 @@ jobs:
- name: Upload helm chart
run: |
cd helm && ./upload_chart.sh
- name: Release Docker CLI only on formal releases
if: "!github.event.release.prerelease"
run: |-
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli:${{env.RELEASE_VER}} \
--tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli \
--push \
--file cli.Dockerfile \
.
49 changes: 0 additions & 49 deletions .github/workflows/test_installation.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test_robusta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
poetry install --extras "all"
# Install tabulate version that fixes column width wrapping. Cannot be added to pypi as a git dependency, so adding it here
pip install git+https://github.com/astanin/python-tabulate.git@b2c26bcb70e497f674b38aa7e29de12c0123708a#egg=tabulate
# robusta-cli is a separate project now, it needs to be installed for gen-config
pip install robusta-cli
# build robusta docker images for tests which run in-cluster on KIND
- run: |-
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/robusta
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fi
if [[ "upgrade-cli" == "$COMMANDS" ]]; then
docker pull us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli > /dev/null 2>&1 & spinner
echo 'Upgrade complete'
docker run -it --rm --net host -v ~/.aws:/root/.aws -v ~/.config/gcloud:/root/.config/gcloud -v ${PWD}:/workingdir -w=/workingdir -v ~/.kube:/root/.kube us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli robusta version
docker run -it --rm --net host -v ~/.aws:/root/.aws -v ~/.config/gcloud:/root/.config/gcloud -v ${PWD}:/workingdir -w=/workingdir -v ~/.kube:/root/.kube us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli version
exit 0
fi

docker run -it --rm --net host -v ~/.aws:/root/.aws -v ~/.config/gcloud:/root/.config/gcloud -v ${PWD}:/workingdir -w=/workingdir -v ~/.kube:/root/.kube us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli robusta $COMMANDS
docker run -it --rm --net host -v ~/.aws:/root/.aws -v ~/.config/gcloud:/root/.config/gcloud -v ${PWD}:/workingdir -w=/workingdir -v ~/.kube:/root/.kube us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli $COMMANDS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Playbook API Changes

This page documents breaking changes to the Robusta API, and how to update custom playbook actions between versions.

Using new 'robusta-api' package from Robusta version 0.14
===============================================

Old versions used the ``robusta-cli`` package for the api headers. Please use the new ``robusta-api`` package.

Updating Custom Playbooks to Robusta 0.10.17
===============================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ An example ``pyproject.toml`` would be:
#some-dependency = "^1.2.3"
[tool.poetry.dev-dependencies]
robusta-cli = "^0.8.9"
robusta-api = "^0.14"
[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ The Basics
Setting up a development environment
--------------------------------------

Install the ``robusta-cli`` package locally, so you have autocompletion in your IDE. This is really important, at the playbooks API is not yet fully documented online.
Install the ``robusta-api`` package locally, so you have autocompletion in your IDE. This is really important, at the playbooks API is not yet fully documented online.

.. note::

Older versions used the ``robusta-cli`` package for the api headers. Please use the new ``robusta-api`` package.

Implementing your first playbook
-------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "robusta-cli"
name = "robusta-api"
version = "0.0.0"
description = ""
authors = ["Natan Yellin <aantn@users.noreply.github.com>"]
authors = ["Arik Alon <arikalon1@users.noreply.github.com>"]
packages = [
{ include = "robusta", from = "src" },
]
Expand All @@ -16,9 +16,6 @@ line_length = 120
multi_line_output = 3
include_trailing_comma = true

[tool.poetry.scripts]
robusta = "robusta.cli.main:app"


[tool.poetry.dependencies]
# Robusta CLI should work on 3.8, but the core code requires 3.9+. Both
Expand Down Expand Up @@ -48,6 +45,7 @@ datadog-api-client = { version = "^1.2.0", optional = true }
dpath = "^2.0.5"
websocket-client = "1.3.3"
prometheus-client = "^0.12.0"
pygal = "^3.0.0"
pyyaml = "^6.0"
pytz = "^2021.3"
poetry-core = "1.1.0a7"
Expand Down Expand Up @@ -94,7 +92,6 @@ jsonref = "^0.2"
Pillow = "^10.3.0"
sphinxcontrib-mermaid = "^0.7.1"
cssselect = "^1.1.0"
pygal = "^3.0.0"
tinycss = "^0.4"
rsa = "^4.8"
sphinxcontrib-details-directive = "^0.1.0"
Expand All @@ -117,7 +114,7 @@ types-toml = "^0.10.2"
types-tabulate = "^0.8.10"

[tool.poetry.extras]
all = ["Flask", "grafana-api", "watchdog", "dulwich", "better-exceptions", "CairoSVG", "tabulate", "kafka-python", "prometheus-api-client", "supabase", "datadog-api-client", "pygal", "tinycss", "cssselect", "rsa", "sentry-sdk", "poetry-core"]
all = ["Flask", "grafana-api", "watchdog", "dulwich", "better-exceptions", "CairoSVG", "tabulate", "kafka-python", "prometheus-api-client", "supabase", "datadog-api-client", "tinycss", "cssselect", "rsa", "sentry-sdk", "poetry-core"]

[tool.poetry.group.dev.dependencies]
sphinx-jinja = { git = "https://github.com/robusta-dev/sphinx-jinja.git" }
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/robusta_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ def _run_cmd(cmd, timeout=None) -> str:
return result.stdout.decode()

def _run_robusta_cli_cmd(self, cmd, timeout=None) -> str:
return self._run_cmd(["poetry", "run", "robusta"] + cmd, timeout)
return self._run_cmd(["robusta"] + cmd, timeout)

0 comments on commit 7531522

Please sign in to comment.