.. include:: ./../defs/external_refs.txt .. _creating_containers: ============================================================================ Getting Started with |sciserver_compute| ============================================================================ In addition to hosting large datasets the |sciserver| also hosts compute environments to analyze these large datasets for academic use with |sciserver_compute|. |sciserver_compute| is "application that allows users to easily create and run Jupyter Notebooks containing code and instructions to analyze and process SciServer hosted data sets." More details about these compute environments can be found in their `documentation `_. Essentially, these compute environments are docker containers with a limited amount of storage and computational resources that can be created from a provided set of images. Documentation on their provided images can be found `here `_. Simply put, this provides a cloud computing environment with some preinstalled software (such as |jupyter| or R) so that you can jump right into accessing the datasets without having to install anything on your computer. To use one of these compute environments you can head directly to the |sciserver_compute| page and click on *Create Container*. Alternatively, the |sciserver| provides some of examples to help users get started in their `Example Notebooks `_ section. This will direct you to some more detailed steps on creating a container. Before creating a container, please take a moment to note the information regarding file storage at the bottom of the |sciserver_compute| page. This make not make perfect sense now, but will become important in the future. Essentially, you will have access to a few different folders in the container but when and how long files will exist may change over time. |sciserver_compute| with |astropath| Dataset & *astropathdb* Access ============================================================================ * Create a |sciserver| account, sign in with it on the |astropath| website and accept the data use agreement as described in :ref:`where_to_start` * navigate to |sciserver_compute| * Click on *Create Container*. * Give the container a unique name and leave the *Domain* alone * Use **SciServer Essentials 3.0** as the *Compute Image* * In *User Volumes* select *AstroPathDocumentation* * Click *Create* in the lower right hand corner To activate the container click on it's name in the drop down table of containers, this should open a new window for the container. Next, you will need to ``pip install`` the package. * Open a "Terminal" by clicking on the icon toward the bottom of the "Launcher" window that opens * In the terminal add the following as is: .. code-block:: text pip install workspace/Storage/bgreen42/AstroPathDocumentation/astropathpy-db/.[sciserver] This will install the package and may take a few minutes. Once that is finished, You can create a new |jupyter| Notebook by clicking the "+" icon at the top of the |jupyter| Lab window and selecting |python| under *Notebook* section. Next, head over to the :ref:`examples_and_tutorials` section of the documentation to see how to run some analyses. Authentication in Compute ========================= Inside SciServer Compute, :class:`~.AstroDB` uses the managed SciScript token: .. code-block:: python from astropathdb import AstroDB db = AstroDB() Explicit ``username``, ``password``, and ``credential_filename`` arguments, local environment credentials, environment tokens, and credential files are ignored. The managed token has no username and password, so ``store="keyring"`` and ``store="both"`` raise an error. An unavailable managed token raises a login error; it does not start a local login. Restore the Compute session before retrying. A refused query keeps the existing Compute connection-error behavior. To share the managed token through the current process environment, log in through the credential manager with ``store="env"``: .. code-block:: python from astropathdb.db_io.credentials import CredentialManager CredentialManager(store="env").login() This exports ``ASTROPATHDB_TOKEN``. Export is process-local, does not write a file, and does not update other notebook kernels or the parent shell. Child processes started afterwards may inherit it. Never log the token or expose it through debugging or process inspection. All instances share the process identity; token reuse does not validate the token with the server. Supplying an existing ``db_connection`` bypasses all authentication options. See :ref:`logging_into_sciserver_locally` for local login, keyring, and token-sharing workflows.