Skip to content

Commit

Permalink
[WIP] don't sync .rh directory onto clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewitt1 committed Apr 25, 2024
1 parent a8735e1 commit ac3ee1c
Show file tree
Hide file tree
Showing 27 changed files with 260 additions and 247 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cluster_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- name: Run all cluster unit tests tests
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v tests/test_resources/test_cluster.py --level unit

- name: Teardown all test clusters
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/local_den_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup Runhouse Config
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.TEST_USERNAME }}
token: ${{ secrets.TEST_TOKEN }}

- name: Update Server URL in Runhouse Config
run: |
echo "api_server_url: http://localhost:8000" >> ~/.rh/config.yaml
# TODO: pull the latest "prod" tag from ECR
- name: Start Den container
run: |
Expand All @@ -65,4 +54,6 @@ jobs:
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level unit
54 changes: 12 additions & 42 deletions .github/workflows/local_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local tests/test_servers/
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local tests/test_servers/
timeout-minutes: 60

Expand Down Expand Up @@ -74,17 +69,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "not servertest and not secrettest and not moduletest and not functiontest and not envtest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "not servertest and not secrettest and not moduletest and not functiontest and not envtest"
timeout-minutes: 60

Expand Down Expand Up @@ -112,17 +102,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "secrettest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "secrettest"
timeout-minutes: 60

Expand All @@ -135,17 +120,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "moduletest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "moduletest"
timeout-minutes: 60

Expand All @@ -158,17 +138,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "functiontest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "functiontest"
timeout-minutes: 60

Expand All @@ -181,16 +156,11 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "envtest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "envtest"
timeout-minutes: 60
55 changes: 12 additions & 43 deletions .github/workflows/local_tests_den_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}


- name: pytest -v --level local tests/test_servers/
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local tests/test_servers/ --api-server-url $API_SERVER_URL
timeout-minutes: 60

Expand Down Expand Up @@ -73,17 +67,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "not servertest and not secrettest and not moduletest and not functiontest and not envtest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "not servertest and not secrettest and not moduletest and not functiontest and not envtest" --api-server-url $API_SERVER_URL
timeout-minutes: 60

Expand Down Expand Up @@ -111,17 +100,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "secrettest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "secrettest" --api-server-url $API_SERVER_URL
timeout-minutes: 60

Expand All @@ -134,17 +118,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "moduletest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "moduletest" --api-server-url $API_SERVER_URL
timeout-minutes: 60

Expand All @@ -157,17 +136,12 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "functiontest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "functiontest" --api-server-url $API_SERVER_URL
timeout-minutes: 60

Expand All @@ -180,16 +154,11 @@ jobs:
- name: Setup Runhouse
uses: ./.github/workflows/setup_runhouse

- name: Setup ~/.rh/config.yaml
uses: ./.github/workflows/setup_rh_config
with:
username: ${{ secrets.CI_ACCOUNT_USERNAME }}
token: ${{ secrets.CI_ACCOUNT_TOKEN }}
api_server_url: ${{ env.API_SERVER_URL }}

- name: pytest -v --level local -k "envtest"
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
RH_TOKEN: ${{ secrets.TEST_TOKEN }}
RH_USERNAME: ${{ secrets.TEST_USERNAME }}
run: pytest -v --level local -k "envtest" --api-server-url $API_SERVER_URL
timeout-minutes: 60
29 changes: 0 additions & 29 deletions .github/workflows/setup_rh_config/action.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:
# - name: Setup Runhouse
# uses: ./.github/workflows/setup_runhouse
#
# - name: Setup ~/.rh/config.yaml
# uses: ./.github/workflows/setup_rh_config
# with:
# username: ${{ secrets.CI_ACCOUNT_USERNAME }}
# token: ${{ secrets.CI_ACCOUNT_TOKEN }}
#
# - name: pytest -v --level unit -k "not den_auth"
# env:
# TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions docs/api/python/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ be started on the cluster on port :code:`32300`.
Server Authentication
---------------------

If desired, Runhouse provides out-of-the-box authentication via users' Runhouse token (generated when
:ref:`logging in <Login/Logout>`) and set locally at: :code:`~/.rh/config.yaml`). This is crucial if the cluster
has ports open to the public internet, as would usually be the case when using the ``tls`` connection type. You may
also set up your own authentication manually inside of your own code, but you should likely still enable Runhouse
authentication to ensure that even your non-user-facing endpoints into the server are secured.
If desired, Runhouse provides out-of-the-box authentication via users' Runhouse cluster token (generated when
:ref:`logging in <Login/Logout>`). This is crucial if the cluster has ports open to the public internet, as would
usually be the case when using the ``tls`` connection type. You may also set up your own authentication manually
inside of your own code, but you should likely still enable Runhouse authentication to ensure that even your
non-user-facing endpoints into the server are secured.

When :ref:`initializing a cluster <Cluster Factory Method>`, you can set the :code:`den_auth` parameter to :code:`True`
to enable token authentication. Calls to the cluster server can then be made using an auth header with the
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorials/api-resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ Runhouse RNS
Setting Config Options
----------------------

Runhouse stores user configs both locally in ``~/.rh/config.yaml`` and
remotely in the Runhouse database, letting you preserve your same config
across environments.
Runhouse stores user configs locally in ``~/.rh/config.yaml``, letting you preserve convenient defaults to re-use
across clusters.

Some configs to consider setting:

Expand Down
4 changes: 1 addition & 3 deletions docs/tutorials/api-secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,7 @@ Login and Logout

The login flow gives you the option to upload locally detected builtin
provider secrets, or load down saved-down Vault secrets into your local
environment. If loading down new secrets, the location (file or env var)
of the new secrets will be logged in your runhouse config yaml at
``~/.rh/config.yaml`` as well. There are some useful APIs as well for
environment. There are some useful APIs as well for
seeing which secrets you have locally configured or stored in Vault.

.. code:: ipython3
Expand Down

0 comments on commit ac3ee1c

Please sign in to comment.