Skip to content

Commit 67d1f52

Browse files
authored
Merge pull request #25 from PurdueRCAC/docs
Updating the documentation
2 parents 64b4c47 + 6128677 commit 67d1f52

File tree

19 files changed

+140
-80
lines changed

19 files changed

+140
-80
lines changed

.github/workflows/publish-docs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Taken from https://github.com/withastro/github-pages/blob/main/.github/workflows/deploy.yml
2+
3+
name: Publish Documentation
4+
5+
on:
6+
# Trigger the workflow every time you push to the `main` branch
7+
# Using a different branch name? Replace `main` with your branch’s name
8+
push:
9+
branches: [main]
10+
paths:
11+
- "docs/**"
12+
# Allows you to run this workflow manually from the Actions tab on GitHub.
13+
workflow_dispatch:
14+
15+
# Allow this job to clone the repo and create a page deployment
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow one concurrent deployment
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout your repository using git
31+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
32+
- name: Install, build, and upload your site output
33+
uses: withastro/action@fc88a7002f0c62327f26fb1b15f2a1d581249278 # v5.1.0
34+
with:
35+
path: docs # The root location of your Astro project inside the repository. (optional)
36+
node-version: 24 # The specific version of Node that should be used to build your site. Defaults to 22. (optional)
37+
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
38+
# build-cmd: pnpm run build # The command to run to build your site. Runs the package build script/task by default. (optional)
39+
40+
deploy:
41+
needs: build
42+
runs-on: ubuntu-latest
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

backend/src/service/helper/deploymentConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export class DeploymentConfigService {
355355
}
356356

357357
private async validateSubdomain(subdomain: string, existingAppId?: number) {
358-
if (subdomain.length > MAX_SUBDOMAIN_LEN || !isRFC1123(subdomain)) {
358+
if (!isRFC1123(subdomain)) {
359359
throw new ValidationError(
360360
"Subdomain must contain only lowercase alphanumeric characters or '-', " +
361361
"start and end with an alphanumeric character, " +

docs/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import starlightLinksValidator from "starlight-links-validator";
55

66
// https://astro.build/config
77
export default defineConfig({
8-
site: "https://docs.anvilcloud.rcac.purdue.edu",
8+
site: "https://purduercac.github.io/AnvilOps",
99
integrations: [
1010
starlight({
1111
plugins: [starlightLinksValidator()],

docs/src/content/docs/guides/deploying-a-database.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We will learn:
1212

1313
## 1. Create an App
1414

15-
Navigate to the [Create App form](https://anvilops.rcac.purdue.edu/create-app).
15+
Navigate to the Create App form for [Anvil Composable](https://anvilops.rcac.purdue.edu/create-app) or [Geddes](https://anvilops.geddes.rcac.purdue.edu/create-app).
1616

1717
Select an organization and a Rancher project.
1818

@@ -25,9 +25,7 @@ This tells AnvilOps to pull a Postgres image from Docker Hub and deploy it in th
2525

2626
## 3. Configure Deployment Options
2727

28-
Set the **Public URL** subdomain to a unique name. Postgres communicates with clients over TCP, not HTTP, so it will not be publicly accessible at this URL.
29-
Instead, we will need to use the cluster-internal hostname below. In this screenshot, that's `anvilops-pg-example.anvilops-pg-example.svc.cluster.local`.
30-
**Write down this value. We will need it to connect to the database.**
28+
Uncheck the box labeled `Make my app public` since our database is not a web application.
3129

3230
Set the port number to `5432` so that AnvilOps knows which port to expose outside of the Postgres container.
3331

@@ -59,32 +57,38 @@ We use volume mounts to specify the paths we want to keep when the app is update
5957

6058
Consider the file system to be ephemeral except the paths included in your volume mounts.
6159

62-
## 6. Connect to the Database
60+
## 6. (Optional) Set the namespace
61+
62+
Open the Advanced dropdown. AnvilOps will have already filled in a unique namespace for your application, which you can edit. Your application will be reachable from within the cluster at `<namespace>.<namespace>.svc.cluster.local`.
63+
64+
![](./deploying-a-database/advanced-options.png)
65+
66+
## 7. Connect to the Database
6367

6468
Recall the internal address you created earlier.
65-
In this example, it's `anvilops-pg-example.anvilops-pg-example.svc.cluster.local`. It should follow the form `anvilops-{subdomain}.anvilops-{subdomain}.svc.cluster.local`, where `{subdomain}` is what you typed into the Public URL field.
69+
In this example, it's `pg-example.pg-example.svc.cluster.local`.
6670

67-
Let's create a connection string from this hostname. We can connec to the database at:
71+
Let's create a connection string from this hostname. We can connect to the database at:
6872

6973
```
70-
postgresql://anvilops:password@anvilops-pg-example.anvilops-pg-example.svc.cluster.local:80
74+
postgresql://anvilops:password@pg-example.pg-example.svc.cluster.local:80
7175
```
7276

7377
Assuming these values:
7478

75-
- Host: `anvilops-pg-example.anvilops-pg-example.svc.cluster.local`
79+
- Host: `pg-example.pg-example.svc.cluster.local`
7680
- Port: `80` (The port must be set to 80. AnvilOps always exposes your service at port 80 within the cluster.)
7781
- Username: `anvilops` (from the environment variable you set in Step 4)
7882
- Password: `password` (from the environment variable you set in Step 4)
7983

80-
Any application running in the same Kubernetes cluster can now access your database with this connection string.
84+
Applications will access your database with this connection string. We recommend deploying an application that connects to this database through AnvilOps and adding them to the same app group. Using a network policy, AnvilOps will ensure that the two can communicate.
8185

82-
If you want to access your database from another AnvilOps app, we recommend placing your connection string in an environment variable and marking it as sensitive.
86+
If you want to access your database from another AnvilOps app, we recommend placing your connection string in its environment variables and marking it as sensitive.
8387

8488
## Limitations
8589

8690
1. This deployment is not designed to scale past one replica. **Do not increase the `Replicas` field.** In AnvilOps, a unique volume is created for every replica, so the instances will not be able to share information.
8791

8892
In most cases, you can get away with scaling vertically by increasing the app's CPU and memory limits.
8993

90-
2. AnvilOps does not expose non-HTTP services to the public. Your database will not be accessible at the "Public URL" because Postgres uses TCP to communicate with clients.
94+
2. AnvilOps does not expose non-HTTP services, such as Postgres, to the public.
47.3 KB
Loading
35.9 KB
Loading

docs/src/content/docs/guides/from-github.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,36 @@ sidebar:
66

77
This tutorial will demonstrate:
88

9-
- How to deploy one of AnvilOps' template applications on Anvil Composable.
9+
- How to deploy one of AnvilOps' template applications.
1010
- How to use Railpack to build applications without a Dockerfile.
1111
- How to use AnvilOps' GitHub integrations for continuous deployment.
1212

13-
Follow along at `https://anvilops.rcac.purdue.edu`.
13+
Follow along at [`https://anvilops.rcac.purdue.edu`](https://anvilops.rcac.purdue.edu) or [`https://anvilops.geddes.rcac.purdue.edu`](https://anvilops.geddes.purdue.edu).
1414

1515
### Prerequisites
1616

1717
You will need to have the AnvilOps GitHub App installed for your organization. This allows AnvilOps to deploy repositories on the cluster. In particular, for this tutorial, the GitHub App is needed for AnvilOps to clone the template repository to your account.
1818

19-
If you do not have access to your own project on Anvil Composable, select the `anvilops_sandbox` project.
19+
If you do not have access to your own project on Anvil Composable, select the `anvilops_sandbox` project. This project can be used temporarily for tests and tutorials, but applications deployed to this project may be deleted at any time.
2020

2121
### Initial Configuration
2222

2323
1. Click the Create App button on the AnvilOps dashboard.
2424
![Create App buttons](./tutorial/create-app-buttons.png)
2525

26-
2. After selecting an Organization (and a Rancher project), select `Git Repository` as the Deployment Source.
26+
2. Select a Rancher project to deploy the application into. A project is a grouping of applications within a Kubernetes cluster. If you do not have access to your own project on Anvil Composable, select the `anvilops_sandbox` project.
2727

28-
3. Click the repository dropdown, and select `External Git Repository`.
28+
3. Select `Git Repository` as the Deployment Source. If the form prompts you to install the GitHub App on your organization, click the button and follow the instructions. The AnvilOps GitHub App allows AnvilOps to clone repositories to your account as well as redeploy applications in response to events.
2929

30-
4. Select the `AnvilOps Demo` template app. You will be prompted to import the `anvilops-demo` repository to your account.
30+
4. Click the repository dropdown, and select `External Git Repository`.
31+
32+
5. Select the `AnvilOps Demo` template app. You will be prompted to import the `anvilops-demo` repository to your account.
3133

3234
The default settings configure AnvilOps to automatically redeploy your application when a new commit is pushed to the `main` branch of your repository.
3335

3436
![Settings for a deployment of the AnvilOps Demo app from a Git repository. The branch is set to main, and the event is set to push.](./tutorial/git-demo.png)
3537

36-
5. Look over the settings that have been autofilled.
38+
6. Look over the settings that have been autofilled.
3739

3840
**Build**: AnvilOps will use Railpack to detect the framework the repository uses([Astro](https://astro.build/)) and build it without extra configuration.
3941

@@ -43,8 +45,8 @@ If you do not have access to your own project on Anvil Composable, select the `a
4345

4446
![Build and deployment options for the AnvilOps demo app. The builder is Railpack, the subdomain is anvilops-demo-96ynq, and the port number is 80.](./tutorial/git-build-deploy.png)
4547

46-
6. Click `Deploy`. In a few minutes, the application should be up and running at \
47-
`https://<subdomain>.anvilcloud.rcac.purdue.edu`.
48+
7. Click `Deploy`. In a few minutes, the application should be up and running at \
49+
`https://<subdomain>.anvilcloud.rcac.purdue.edu`, or `https://<subdomain>.geddes.rcac.purdue.edu`.
4850

4951
![A screenshot of the AnvilOps demo web app.](./tutorial/anvilops-git-demo-app.png)
5052

@@ -59,4 +61,4 @@ Try pushing a commit to the repository to see how AnvilOps updates the deploymen
5961
3. Go back to the dashboard for your app in AnvilOps. Under `Recent Deployments`, you should see a new entry. If you click the `Logs` button for that deployment, you can watch the logs as AnvilOps rebuilds the application.
6062
![A screenshot of the recent deployments for an AnvilOps app. The latest entry has the status Building.](./tutorial/git-recent-deployments.png)
6163

62-
4. When the build completes, go back to `https://<subdomain>.anvilcloud.rcac.purdue.edu` and reload the page. It should have the updated text.
64+
4. When the build completes, reopen your application and reload the page. It should have the updated text.

docs/src/content/docs/guides/from-image.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This tutorial will demonstrate:
99

1010
- How to deploy an application from a preexisting container image.
1111

12-
Follow along at `https://anvilops.rcac.purdue.edu`.
12+
Follow along at [`https://anvilops.rcac.purdue.edu`](https://anvilops.rcac.purdue.edu) or [`https://anvilops.geddes.rcac.purdue.edu`](https://anvilops.geddes.rcac.purdue.edu).
1313

1414
### Getting started
1515

@@ -18,17 +18,17 @@ Follow along at `https://anvilops.rcac.purdue.edu`.
1818

1919
2. After selecting an Organization (and a Rancher project), select `OCI Image` as the Deployment Source.
2020

21-
3. Enter a container image. The image reference should look like `REGISTRY/NAMESPACE/REPOSITORY:TAG`.
21+
3. Enter a container image. The image reference should look like `HOST/NAMESPACE/REPOSITORY:TAG`.
2222

23-
If you are deploying an image available on Docker Hub, you can omit the host. If the image is a Docker Official image, you can omit the repository as well. However, it's strongly advised to use Anvil's [Docker Hub cache](https://www.rcac.purdue.edu/knowledge/anvil/composable/registry#_using_the_anvil_registry_docker_hub_cache) instead.
23+
Where possible, it is strongly advised to use Anvil's [Docker Hub cache](https://www.rcac.purdue.edu/knowledge/anvil/composable/registry#_using_the_anvil_registry_docker_hub_cache) instead of pulling directly from Docker Hub to avoid rate limiting.
2424

2525
Some example container image references:
2626

27-
- `registry.anvil.rcac.purdue.edu/anvilops/foo:bar`
27+
- `registry.anvil.rcac.purdue.edu/docker-hub-cache/postgis:latest`
2828
- Host: `registry.anvil.rcac.purdue.edu`
29-
- Namespace: `anvilops`
30-
- Image: `foo`
31-
- Tag: `bar`
29+
- Namespace: `docker-hub-cache`
30+
- Image: `postgis`
31+
- Tag: `latest`
3232
- `nginx:1.28-alpine`
3333
- Host: `docker.io` (default)
3434
- Namespace: `library` (default)
@@ -37,9 +37,9 @@ Follow along at `https://anvilops.rcac.purdue.edu`.
3737

3838
### Deployment options
3939

40-
4. Select a unique subdomain for your app. Your app will be made publicly accessible at `https://<subdomain>.anvilcloud.rcac.purdue.edu`.
40+
4. Choose whether to expose your app publicly, and if so, select a subdomain. Your app will be made publicly accessible at `https://<subdomain>.anvilcloud.rcac.purdue.edu`, or `https://<subdomain>.geddes.rcac.purdue.edu`.
4141

42-
5. Enter the port number your application listens on. Kubernetes will route requests to `https://<subdomain>.anvilcloud.rcac.purdue.edu` to this port for your applications to process.
42+
5. Enter the port number your application listens on. Kubernetes will route requests to this port for your application to process.
4343

4444
6. Add any environment variables your app requires. Environment variables can be marked as sensitive. Sensitive environment variables cannot be viewed after they are set, although they can be updated.
4545

docs/src/content/docs/guides/getting-started.mdx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@ sidebar:
66

77
import { Steps } from "@astrojs/starlight/components";
88

9-
If you would like to deploy an application on Anvil Composable, follow these instructions on `https://anvilops.rcac.purdue.edu`. If you would like to deploy on Geddes, follow these instructions on `https://anvilops.geddes.rcac.purdue.edu`.
10-
11-
## Setting Up Your Account
12-
13-
<Steps>
14-
15-
1. Sign in to AnvilOps.
16-
This will create an AnvilOps account for you.
17-
18-
2. Navigate to the dashboard page.
19-
3. Link your GitHub organization or personal account.
20-
21-
This will allow you to deploy applications from GitHub repositories.
22-
Make sure you grant the AnvilOps GitHub App permission to access any repositories you want to deploy!
23-
24-
</Steps>
9+
If you would like to deploy an application on Anvil Composable, follow along at [`https://anvilops.rcac.purdue.edu`](https://anvilops.rcac.purdue.edu). If you would like to deploy on Geddes, follow these instructions on [`https://anvilops.geddes.rcac.purdue.edu`](https://anvilops.geddes.rcac.purdue.edu).
2510

2611
## Creating an App
2712

@@ -40,6 +25,8 @@ If you would like to deploy an application on Anvil Composable, follow these ins
4025

4126
Navigate to the Create App page in order to configure and launch your app. You will need to select your Project, the repository or image you would like to deploy, a subdomain, and the port number of the application.
4227

28+
If your app is a web application, you can make it publicly accessible at an available subdomain of your choice. Otherwise, uncheck the `Make my app public` box.
29+
4330
If you are deploying a Git repository, you will need to specify the build configuration.
4431

4532
If your repository already contains a Dockerfile, select the `Dockerfile` option and provide the path to the file. For instance, if the Dockerfile is in the root directory of your application, enter `Dockerfile`.
-5.21 KB
Loading

0 commit comments

Comments
 (0)