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

Chains Smoke Tests #1298

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Chains Smoke Tests #1298

merged 3 commits into from
Jan 7, 2025

Conversation

marius-baseten
Copy link
Contributor

@marius-baseten marius-baseten commented Jan 6, 2025

🚀 What

E2E deployment and invocation of a published chain. The primary test focus is the truss package with CLI (not the test chain code and not baseten backend).

  • Truss is installed in a separate virtual env, independent of the poetry env that orchestrates the tests.
  • Upgraded ubuntu image. If this works well for this workflow, we should do it for all. This also required:
  • Upgraded the CI python version from 3.9.9 -> 3.9.21.

💻 How

🔬 Testing

Locally and testing the CI workflow here: https://github.com/basetenlabs/truss/actions/runs/12641883558

Note that for testing I had to
a) Add another trigger, so that the workflow can be run, while it's not merged to main. This trigger is removed from the final PR version. Until it's merged, the WF cannot be run again in this state.
b) Create a RC from #1296 and hardcode it in the worklow (also removed in final PR) because the tests need overridable truss rc paths.

@marius-baseten marius-baseten changed the base branch from main to marius/smoke-prep January 6, 2025 22:00
@marius-baseten marius-baseten force-pushed the marius/soke branch 11 times, most recently from b76ea4f to af31f7f Compare January 6, 2025 22:59
Copy link
Collaborator

@squidarth squidarth left a comment

Choose a reason for hiding this comment

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

LGTM -- I think after merging this it'll be much easier to iterate on this. Most of my comments relate to how we're invoking chains and whether it would be possible to use the Python SDK

return stub.StubBase.from_url(url, context, options)


def write_trussrc(dir_path: pathlib.Path) -> pathlib.Path:
Copy link
Collaborator

Choose a reason for hiding this comment

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

[non-blocking] maybe we should extend truss.login to support these other params.... https://docs.baseten.co/truss-reference/python-sdk#truss-login

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm - is there a customer use case or is this only relevant for your internal dev?

tmpdir, truss_rc_path, remote = prepare

chain_src = CHAINS_ROOT / "tests" / "itest_chain" / "itest_chain.py"
command = f"truss chains push {chain_src} --publish --name=itest_publish --no-wait"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to other comments other here, feels like a good opportunity to improve the truss python sdk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean - does #1298 (comment) clarify it though?

env:
TRUSS_ENV_PATH: ${{ github.workspace }}/truss_env
run: |
BASETEN_API_KEY_STAGING="${{ secrets.BASETEN_API_KEY_STAGING }}" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

what account are we using 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.

marius.killinger+staging@baseten.co

Can we somehow create name+PW accounts on staging? Then I could create a dedicated account and add it to onePW. But in a way it doesn't really matter, since everyone can just hijack anything on staging.

return stdout, stderr


def wait_ready(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't. There is by intention an "air gap" between the system under test (the truss CLI installed in a separate env) and the poetry env that orchestrates the tests. One reason for that is that we want to test a pip, non-dev user install, i.e. making sure that CLI code branches don't accidentally depend on dev-only dependencies (we a few times bad truss releases where something passed our CI tests, but in the user install a dependency was missing).

For the same reason, I don't want to use the python SDK, but instead make sure the CLI works as most users would use it - there was so far 0 testing for the CLI, the SDK is mostly covered by existing integration tests.

Base automatically changed from marius/smoke-prep to main January 7, 2025 17:51
@marius-baseten marius-baseten merged commit d92797d into main Jan 7, 2025
4 checks passed
@marius-baseten marius-baseten deleted the marius/soke branch January 7, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants