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

Basic migration of conda-store (core) docs #685

Merged
merged 6 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions docusaurus-docs/README.md

This file was deleted.

88 changes: 88 additions & 0 deletions docusaurus-docs/community/contribute/contribute-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,92 @@ description: Contribute to conda-store's codebase

# Contribute code

:::warning
This page is in active development, content may be inaccurate and incomplete.
:::

## Set up development environment

### Docker (recommended)

Install the following dependencies before developing on conda-store.

- [docker](https://docs.docker.com/engine/install/)
- [docker-compose](https://docs.docker.com/compose/install/)

To deploy `conda-store` run the following command

```shell
docker-compose up --build -d
```

:::important
Many of the conda-store docker images are built/tested for amd64(x86-64)
there will be a performance impact when building and running on
arm architectures. Otherwise this workflow has been shown to run and build on OSX.
Notice the `architecture: amd64` whithin the docker-compose.yaml files.
:::

The following resources will be available:

| Resource | Localhost port | username | password |
|----------|----------------|----------|----------|
| conda-store web server | [localhost:8080](http://localhost:8080)| `admin` | `password`|
| [JupyterHub](https://jupyter.org/hub) | [localhost:8000](http://localhost:8000) | any | `test` |
| [MinIO](https://min.io/) S3 | [localhost:9000](http://localhost:9000) | `admin` | `password` |
| [PostgreSQL](https://www.postgresql.org/) (database: `conda-store`)| [localhost:5432](http://localhost:5432) | `admin` | `password` |
| [Redis](https://www.redis.com/) | [localhost:6379](http://localhost:6379) | - | password |

On a fast machine this deployment should only take 10 or so seconds
assuming the docker images have been partially built before.

If you are making and changes to conda-store-server and would like to see
those changes in the deployment, run:

```shell
docker-compose down -v # not always necessary
docker-compose up --build
```

### Linux

1. Install the following dependencies before developing on conda-store:

- [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html)

2. Install the development dependencies and activate the environment:

```shell
# replace this with environment-macos-dev.yaml or environment-windows-dev.yaml
# if you are on Mac or Windows
conda env create -f conda-store-server/environment-dev.yaml
conda activate conda-store-server-dev
```

3. Running `conda-store` in `--standalone` mode launches celery as a
subprocess of the web server.

```
python -m conda_store_server.server --standalone
```

4. Visit [localhost:8080](http://localhost:8080/)

## conda-store-ui

<!-- TODO -->

## jupyterlab-conda-store

<!-- TODO -->

## Workflows

### Changes to API

The REST API is considered somewhat stable. If any changes are made to
the API make sure the update the OpenAPI/Swagger specification in
`docs/_static/openapi.json`. This may be downloaded from the `/docs`
endpoint when running conda-store. Ensure that the
`c.CondaStoreServer.url_prefix` is set to `/` when generating the
endpoints.
42 changes: 41 additions & 1 deletion docusaurus-docs/community/contribute/contribute-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,44 @@ description: Contribute to conda-store's documentation

# Contribute documentation

<!-- TODO -->
> **Note**
> This page in active development.

The new conda-store documentation website is built using [Docusaurus 2](https://docusaurus.io/) and organized using the [Diátaxis framework](https://diataxis.fr).

## Local Development

### Pre-requisites

1. Fork and clone the conda-store repository: `git clone https://github.com/<your-username>/conda-store.git`
2. Install [Node.js](https://nodejs.org/en), and verify installation with: `node -v`

### Local development

:::note
You can also create an isolated environment for development.
:::

Navigate to `docusaurus-docs` repository, and run:

```bash
npm install
```

You can then start a development server with the following:

```bash
npm run start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build website

Run:

```bash
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
69 changes: 68 additions & 1 deletion docusaurus-docs/community/contribute/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,71 @@ description: Contribute to conda-store

# Run test suite

<!-- TODO -->
:::warning
This page is in active development, content may be inaccurate and incomplete.
:::

## conda-store (client)

Linting and formatting checks can be performed via hatch.

```shell
$ cd conda-store
$ hatch env run -e dev lint
```

Running integration tests. These tests are stateful! So you will need
to clear the state if you have run the conda-store-server service on
docker.

```shell
$ cd conda-store
$ docker-compose down -v # ensure you've cleared state
$ docker-compose up --build
# wait until the conda-store-server is running check by visiting localhost:8080

$ pip install -e .
$ ./tests/unauthenticated-tests.sh
$ ./tests/authenticated-tests.sh
$ export CONDA_STORE_URL=http://localhost:8080/conda-store
$ export CONDA_STORE_AUTH=basic
$ export CONDA_STORE_USERNAME=username
$ export CONDA_STORE_PASSWORD=password
$ ./tests/shebang.sh
```

## conda-store-server

Linting and formatting checks can be performed via hatch.

```shell
$ cd conda-store-server
$ hatch env run -e dev lint
```

Checking that package builds

```shell
$ cd conda-store-server
$ hatch build
```

Running unit tests

```shell
$ cd conda-store-server
$ pytest
```

Running integration tests. These tests are stateful! So you will need
to clear the state if you have run the conda-store-server service on
docker.

```shell
$ cd conda-store-server
$ docker-compose down -v # ensure you've cleared state
$ docker-compose up --build
# wait until the conda-store-server is running check by visiting localhos:8080
$ hatch env run -e dev playwright-test
$ hatch env run -e dev integration-test
```
2 changes: 1 addition & 1 deletion docusaurus-docs/community/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
description: Brand design assets
---

# Brand design assets
# Brand and design assets
9 changes: 9 additions & 0 deletions docusaurus-docs/community/policies/backwards-compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description: Backwards compatibility policy
---

# Backwards compatibility policy

:::note
This page is in active development, and will be available soon.
:::
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 2
description: Tutorials
sidebar_position: 3
description: Policies for community governance
---

# Tutorials
# Governance policies

import DocCardList from '@theme/DocCardList';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
Expand Down
9 changes: 9 additions & 0 deletions docusaurus-docs/community/policies/upstream-contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description: Upstream contribution policy
---

# Upstream contribution policy

:::note
This page is in active development, and will be available soon.
:::
Loading
Loading