Skip to content
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
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/delete-vm.yaml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/deploy-vm.yml

This file was deleted.

110 changes: 0 additions & 110 deletions .github/workflows/packer.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/preview-vm.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
"package.json": ".babelrc, .editorconfig, .eslint*, .figma*, .github*, .huskyrc*, plopfile*, .prettier*, .vercel*, .vscode*, Dockerfile, .dockerignore, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts"
"package.json": ".babelrc, .editorconfig, .eslint*, .figma*, .github*, .huskyrc*, plopfile*, .prettier*, .vercel*, .vscode*, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts"
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [
{
"label": "Switch Omicron to Pinned Version",
"detail": "Checks out the pinned version as specified in packer.yaml",
"detail": "Checks out the pinned version as specified in OMICRON_VERSION",
"type": "shell",
"command": "tools/checkout_pinned_omicron.sh"
},
Expand Down
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions OMICRON_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c52656d6226a573bc5a8e0c4bdc94a5bd8080f45
4 changes: 2 additions & 2 deletions docs/serve-from-nexus.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Following the rest of the instructions is only necessary if you want to build th

### Choosing a Console version to download

Most of the time you will want the latest commit on `main`. Look at `libs/api/__generated__/OMICRON_VERSION` to see what Omicron SHA that version of the console expects. Often it will work with a newer version of the API, but don't be surprised if it doesn't.
Most of the time you will want the latest commit on `main`. Look at [`OMICRON_VERSION`](/OMICRON_VERSION) to see what Omicron SHA that version of the console expects. Often it will work with a newer version of the API, but don't be surprised if it doesn't.

## Dependencies

Expand All @@ -19,7 +19,7 @@ Most of the time you will want the latest commit on `main`. Look at `libs/api/__

## Note about pinned omicron version

The API client in the console is generated from a specific omicron commit (see [`OMICRON_VERSION`](/libs/api/__generated__/OMICRON_VERSION)), which means we can only be sure the API calls will work if you're running that version of Nexus. However, this shouldn't be a big issue for dev/testing because:
The API client in the console is generated from a specific omicron commit (see [`OMICRON_VERSION`](/OMICRON_VERSION)), which means we can only be sure the API calls will work if you're running that version of Nexus. However, this shouldn't be a big issue for dev/testing because:

- We update the generated API client in console frequently
- Most API changes are additive, so if you're not running _too_ new a Nexus you'll probably be fine
Expand Down
12 changes: 2 additions & 10 deletions docs/update-pinned-api.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# Updating the pinned API version

There are, in a way, two sources of truth for the omicron version pinned for deploy alongside the console, and they need to be kept in sync. Eventually we will make this process more automatic.

The primary source of truth, in the sense that it determines what is actually deployed, is the packer image ID in `tools/create_gcp/instance.sh`. Unless that is changed, the API version deployed will not change. But if you want to change the packer image, you have to get a new one to build by first changing the `API_VERSION` env var set in `.github/workflows/packer.yaml`.

## Setup

The API generation script assumes you have `omicron` and `oxide.ts` cloned under the same parent directory as the console. You should also run `npm install` in `oxide.ts/generator`.

## Instructions

1. Update `API_VERSION` in [`packer.yaml`](https://github.com/oxidecomputer/console/blob/c90ac1660273dbee2a2fe5456fc8318057444a13/.github/workflows/packer.yaml#L49) with new Omicron commit hash
1. Update [`OMICRON_VERSION`](/OMICRON_VERSION) with new Omicron commit hash
1. Update the generated API client by running `yarn gen-api`. This will automatically check out the omicron commit specified as `API_VERSION`. If you forget this step, a safety test in `libs/api` will fail.
1. Fix any type errors introduced by changes to the generated code
1. Commit and push to a branch
1. Wait for `Packer` github action to complete, followed by a bot commit that updates the packer image ID in [`tools/create_gcp_instance.sh`](https://github.com/oxidecomputer/console/blob/d046263cbfbb80b08757e432a8fcd980b8facbe3/tools/create_gcp_instance.sh#L23).
1. Test deployed version on GCP

## Available omicron versions

The list of allowed omicron hashes (i.e., hashes for which there is a docker image for us to pull in) is available [here](https://github.com/orgs/oxidecomputer/packages/container/omicron/versions). That link is probably not accessible to everyone, but it basically contains an image corresponding to every commit on omicron `main` as well as the latest commit on every branch with a PR.

**We should only be pinning omicron `main` commits in console `main`.** Occasionally, in an in-progress console PR, we may want to _temporarily_ pin to a commit from an as-yet-unmerged API branch. But such a PR should **not** be merged into console `main` until the omicron PR is merged and the pinned version in console updated accordingly.

While you can technically pin an omicron branch name instead of a commit, that's probably not a good idea, because even if that branch gets updated, your console branch won't until something triggers a new packer build. It is always better to pin the commit hash corresponding to an omicron branch and then update it when that branch gets more commits.
While you can technically pin an omicron branch name instead of a commit, that's probably not a good idea, because even if that branch gets updated, your console branch won't. It is always better to pin the commit hash corresponding to an omicron branch and then update it when that branch gets more commits.
11 changes: 5 additions & 6 deletions libs/api/__tests__/safety.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ it('Generated API client version matches API version specified for deployment',
.readFileSync(path.resolve(__dirname, '../__generated__/OMICRON_VERSION'), 'utf8')
.split('\n')[1]

const packerConfig = fs.readFileSync(
path.resolve(__dirname, '../../../.github/workflows/packer.yaml'),
const pinnedVersion = fs.readFileSync(
path.resolve(__dirname, '../../../OMICRON_VERSION'),
'utf8'
)
const deployedVersion = /API_VERSION: ([0-9a-f]+)/.exec(packerConfig)?.[1]

// if this test fails, most likely you have updated the API_VERSION in packer.yaml
// without re-running `yarn gen-api`
expect(generatedVersion).toEqual(deployedVersion)
// if this test fails, most likely you have updated the API_VERSION in
// console/OMICRON_VERSION without re-running `yarn gen-api`
expect(generatedVersion).toEqual(pinnedVersion)
})

const grepFiles = (s: string) =>
Expand Down
42 changes: 0 additions & 42 deletions packer/README.txt

This file was deleted.

17 changes: 0 additions & 17 deletions packer/bootstrap-cockroach.sh

This file was deleted.

Loading