Skip to content

Commit 6c2421f

Browse files
authored
Add missing custom component docs pages (#267)
This PR adds the missing page for AWS One Click docs from the [old docs](https://docs.sourcegraph.com/admin/deploy/machine-images/aws-oneclick). It includes the new version of the custom component and imports the [shadcn UI library](https://ui.shadcn.com/) for enhanced design. ### Before ![CleanShot 2024-04-23 at 10 37 33@2x](https://github.com/sourcegraph/docs/assets/12712988/17e8ec68-c00c-4849-b86f-82800fcc0e97) ### After ![CleanShot 2024-04-23 at 10 38 15@2x](https://github.com/sourcegraph/docs/assets/12712988/aa3bf6b4-9ff2-4ced-ba32-f02396b0fa23)
1 parent f81d34c commit 6c2421f

File tree

13 files changed

+1277
-15
lines changed

13 files changed

+1277
-15
lines changed

components.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/styles/tailwind.css",
9+
"baseColor": "zinc",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

docs/admin/deploy/docker-compose/aws.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Install Sourcegraph on Amazon Web Services (AWS)
22

3-
> ⚠️ We recommend new users use our [AWS AMI](https://docs.sourcegraph.com/admin/deploy/machine-images/aws-oneclick) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team [email protected] if they wish to migrate to these deployment models.
3+
> ⚠️ We recommend new users use our [AWS AMI](/admin/deploy/machine-images/aws-oneclick) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team [email protected] if they wish to migrate to these deployment models.
44
55

66

77
This guide will take you through how to deploy Sourcegraph with [Docker Compose](https://docs.docker.com/compose/) to a single EC2 instance on Amazon Web Services (AWS).
88

9-
Deploy a Sourcegraph instance with an [AWS AMI](/admin/deploy/machine-images/aws-ami) or [AWS One-Click](https://docs.sourcegraph.com/admin/deploy/machine-images/aws-oneclick). (Recommended)
9+
Deploy a Sourcegraph instance with an [AWS AMI](/admin/deploy/machine-images/aws-ami) or [AWS One-Click](/admin/deploy/machine-images/aws-oneclick). (Recommended)
1010

1111

1212
## Configure
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# AWS One-Click Installation for Sourcegraph
2+
3+
This page describes how to launch a verified and pre-configured Sourcegraph instance in just ~10 minutes using our one-click CloudFormation template and standard AMIs.
4+
5+
Prefer manually installing on AWS yourself? See our [AMI](/admin/deploy/machine-images/aws-ami) installation options or our [script-install](/admin/deploy/single-node/script) installation options.
6+
7+
## Prerequisites
8+
9+
* An AWS account (most regions are supported, see our [Launcher](#deploy-sourcegraph) below for a complete list)
10+
* General familiarity with AWS
11+
* An [EC2 keypair](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html) for SSH access
12+
* (optional) A Sourcegraph license to unlock features ([view plans](https://sourcegraph.com/pricing) or [learn how licenses work](/admin/subscriptions/index))
13+
14+
## What will be created
15+
16+
Using our wizard, a single EC2 instance will be created with the following:
17+
18+
- EBS root volume: 50GB
19+
- EBS data volume: 500GB - your Sourcegraph data (code and search indices.)
20+
- AWS Network Security Group
21+
- The latest version of Sourcegraph
22+
- (optional) DNS and TLS via AWS Load Balancer and AWS Certificate Manager
23+
24+
<Callout type="note">The instance will launch in the default VPC. If your AWS user does not have a default VPC, or the option `Auto-assign public IPv4 address` is not enabled for a subnet within that VPC, please see our [Manual AMI](/admin/deploy/machine-images/aws-ami) instructions instead.</Callout>
25+
26+
![aws-oneclick](https://storage.googleapis.com/sourcegraph-assets/Docs/aws-oneclick-diagram.png)
27+
28+
## Determine your instance size
29+
30+
The number of users and repositories you will use with Sourcegraph determines your instance size. If you fall between two sizes, choose the larger of the two.
31+
32+
Example: With 8,000 users with 80,000 repositories, your instance size would be **L**. If you have 1,000 users with 80,000 repositories, then size **M**.
33+
34+
| | **XS** | **S** | **M** | **L** | **XL** |
35+
| -------------------- | ----------- | ----------- | ----------- | ------------ | ------------ |
36+
| **Users** | `<= 500` | `<= 1,000` | `<= 5,000` | `<= 10,000` | `<= 20,000` |
37+
| **Repositories** | `<= 5,000` | `<= 10,000` | `<= 50,000` | `<= 100,000` | `<= 250,000` |
38+
| **Recommended Type** | m6a.2xlarge | m6a.4xlarge | m6a.8xlarge | m6a.12xlarge | m6a.24xlarge |
39+
| **Minimum Type** | m6a.2xlarge | m6a.2xlarge | m6a.4xlarge | m6a.8xlarge | m6a.12xlarge |
40+
41+
## Deploy Sourcegraph 🎉
42+
43+
<Callout type="note">For security, please follow [Amazon best practices](https://docs.aws.amazon.com/accounts/latest/reference/best-practices-root-user.html) and _do not deploy Sourcegraph using your AWS account root user.</Callout>
44+
45+
<Callout type="note">By default the CloudFormation template will create standard EBS volumes. If you have special EBS volume encryption requirements, please see the [AWS EBS Encryption guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) and install Sourcegraph using our [Manual AMI](/admin/deploy/machine-images/aws-ami) instructions instead.</Callout>
46+
47+
Choose an AWS Region in the launcher below and click **Launch Stack**. When prompted, choose your **SSH Keypair** and **Sourcegraph Instance Size** per the chart above, then **Create Stack**.
48+
49+
<AWSOneClickLaunchForm />
50+
51+
If you're running into any problem, see our [Troubleshooting guide](/admin/troubleshooting).
52+
53+
### Confirm you can access Sourcegraph
54+
55+
Find the URL of your Sourcegraph instance in the **Outputs** section of the AWS Stack. On first launch, Sourcegraph may take ~5 minutes to start and may display a `404 not found` page temporarily.
56+
57+
### Executors
58+
59+
Executors are supported using [native kubernetes executors](/admin/executors/deploy_executors_kubernetes).
60+
61+
Executors support [auto-indexing](/code-search/code-navigation/auto_indexing) and [server-side batch changes](/batch_changes/explanations/server_side).
62+
63+
To enable executors you must do the following:
64+
65+
1. Connect to the AMI instance using `ssh`
66+
2. Run `cd /home/ec2-user/deploy/install/`
67+
3. Replace the placeholder `executor.frontendPassword` in `override.yaml`
68+
4. Run the following command to update the executor
69+
70+
```curl
71+
helm upgrade -i -f ./override.yaml --version "$(cat /home/ec2-user/.sourcegraph-version)" executor sourcegraph/sourcegraph-executor-k8s
72+
```
73+
74+
1. Adding the following to the site-admin config using the password you chose previously
75+
76+
```curl
77+
"executors.accessToken": "<exector.frontendPassword>",
78+
"executors.frontendURL": "http://sourcegraph-frontend:30080",
79+
"codeIntelAutoIndexing.enabled": true
80+
```
81+
82+
1. Check `Site-Admin > Executors > Instances` to verify the executor connected successfully. If it does not appear try reboot the instance
83+
84+
To use server-side batch changes you will need to enable the `native-ssbc-execution` [feature flag](/admin/executors/native_execution#enable).
85+
86+
### Secure your instance
87+
88+
By default Sourcegraph will be available over HTTP on the public internet. To secure it you should now perform the following:
89+
90+
1. [Configure DNS and HTTPS/TLS](/admin/deploy/machine-images/aws-ami#networking) using an AWS Load Balancer and AWS Certificate Manager.
91+
2. [Configure user authentication](/admin/auth/) (SSO, SAML, OpenID Connect, etc.)
92+
3. [Review the new Network Security Group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) to prevent access from the public internet and follow the principle of least privilege.
93+
94+
## Managing Sourcegraph
95+
96+
### Backup and restore
97+
98+
We strongly recommend you taking [snapshots of the entire Sourcegraph data EBS volume](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-snapshot.html) on an [automatic, scheduled basis](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html). Only the Sourcegraph data volume (500G) needs to be backed up.
99+
100+
To restore from a backup, simply follow our [upgrade instructions](/admin/deploy/machine-images/aws-ami#upgrade) and skip directly to **Step 2: Launch a new instance** - choosing your desired Sourcegraph version and your backed up data volume.
101+
102+
### Upgrading your Sourcegraph instance
103+
104+
Updates are released every month, and upgrading is a simple process: backup your instance, detach the Sourcegraph data volume, and start a new instance using the latest AMI with your data volume attached. For step-by-step instructions [see here](/admin/deploy/machine-images/aws-ami#upgrade).
105+
106+
### Monitoring & alerting
107+
108+
Sourcegraph comes with extensive built-in monitoring dashboards & the ability to configure alerts. Please see our [monitoring guide](/admin/how-to/monitoring-guide) for more information.
109+
110+
### Get Support
111+
112+
Feel free to reach out to `[email protected]` if you have any questions.
113+
114+
Business support, training, Slack support, SLAs, and dedicated Technical Advisors are all available through [Business and Enterprise plans](https://sourcegraph.com/pricing).

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
"@headlessui/react": "^1.7.13",
1717
"@heroicons/react": "^2.0.18",
1818
"@next/third-parties": "^14.1.4",
19+
"@radix-ui/react-select": "^2.0.0",
20+
"@radix-ui/react-slot": "^1.0.2",
1921
"@tailwindcss/typography": "^0.5.7",
2022
"@types/node": "20.4.9",
2123
"@types/react": "18.2.20",
2224
"@types/react-dom": "18.2.7",
2325
"@types/react-highlight-words": "^0.16.4",
2426
"algoliasearch": "^4.22.1",
2527
"autoprefixer": "^10.4.12",
28+
"class-variance-authority": "^0.7.0",
2629
"clsx": "^1.2.1",
2730
"contentlayer": "^0.3.4",
2831
"date-fns": "^2.30.0",
@@ -31,6 +34,7 @@
3134
"github-slugger": "^2.0.0",
3235
"js-yaml": "^4.1.0",
3336
"kbar": "^0.1.0-beta.44",
37+
"lucide-react": "^0.372.0",
3438
"next": "^13.5.6",
3539
"next-contentlayer": "^0.3.4",
3640
"next-themes": "^0.2.1",
@@ -45,7 +49,9 @@
4549
"remark-gfm": "3.0.1",
4650
"shiki": "^0.14.5",
4751
"simple-functional-loader": "^1.2.1",
52+
"tailwind-merge": "^2.3.0",
4853
"tailwindcss": "^3.3.3",
54+
"tailwindcss-animate": "^1.0.7",
4955
"typescript": "5.1.6"
5056
},
5157
"devDependencies": {

0 commit comments

Comments
 (0)