Skip to content

Commit

Permalink
Merge branch 'main' into feature/ingress-nginx-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
achton authored Sep 19, 2024
2 parents f5e5a98 + f8958ba commit a2eae7d
Show file tree
Hide file tree
Showing 43 changed files with 2,017 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependacheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
dependacheck:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].7
- name: Check that images are checked by dependabot
run: |
./tools/dependacheck/dependacheck.sh
4 changes: 2 additions & 2 deletions .github/workflows/diagrams-render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Render Drawio diagrams
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].7
- name: Install Task
uses: Arduino/actions/setup-taskfile@master
- name: Clean render
Expand All @@ -34,7 +34,7 @@ jobs:
} >>"$GITHUB_ENV"
- name: Commit changed files
uses: stefanzweifel/[email protected].0
uses: stefanzweifel/[email protected].1
with:
commit_message: "diagrams: re-render of updated diagrams"
commit_user_name: "${{ env.GIT_COMMIT_COMMITTER_NAME }}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dplsh-build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
image-url: ghcr.io/danskernesdigitalebibliotek/dpl-platform/dplsh
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
- name: Install Task
uses: arduino/setup-task@v2
- name: Log in to the Container registry
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
# run som tests on the image, while still avoiding to have to rebuild the
# image when we do the final build.
- name: Build and export to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: tools/dplsh
load: true
Expand All @@ -80,7 +80,7 @@ jobs:
working-directory: tools/dplsh

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: tools/dplsh
platforms: linux/amd64,linux/arm64
Expand All @@ -91,7 +91,7 @@ jobs:

# Create a github release if this was a tag.
- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/markdown-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].7
# git with HTTP authentication provides an easy way for us to install
# unreleased commits of NPM projects.
- name: Reconfigure git to use HTTP authentication
run: git config --global url."https://${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf ssh://[email protected]/
- name: Install problem matcher
uses: xt0rted/markdownlint-problem-matcher@v2
uses: xt0rted/markdownlint-problem-matcher@v3
- name: Lint Markdown
run: npx markdownlint-cli2
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].7
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/terraform-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
terraform_format:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: hashicorp/setup-terraform@v3.0.0
- uses: actions/[email protected].7
- uses: hashicorp/setup-terraform@v3.1.2
- name: Terraform fmt
id: fmt
run: terraform fmt -recursive -check infrastructure/terraform
Expand Down
Binary file added docs/images/lagoon-ui-tasks-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/runbooks/changing-and-releasing-new-dplsh-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Make changes to DPLSH

## When to use

When for example the `kubectl` or other dependencies needs updating

## Make the change

1. Go to the DPLSH directory and make the necessary changes on a new branch
2. Build DPLSH locally by running `IMAGE_URL=dplsh IMAGE_TAG=someTagName
task build`
3. Test that it works by running `DPLSH_IMAGE=dplsh:local ./dplsh` and running
what ever commands need to be run to test that the change has the desired effect
4. Check what version DPLSH is at here:
<https://github.com/danskernesdigitalebibliotek/dpl-platform/releases>
5. Push the branch, have it review and merge it into `main`
6. Push a new tag to `main`. The tag should look like this: `dplsh-x.x.x`.
(If in doubt about what version to bump to; read this: <https://semver.org/>)
7. Wait for main to automically build and release the new version
8. Go to your main branch, enter the `/infrastructure` directory and
run `../tools/dplsh/dplsh.sh --update`.

You are done and have the newest version of DPLSH on your machine.
69 changes: 69 additions & 0 deletions docs/runbooks/ui-sync-site-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# UI: Synchronize site state

## When to use

If you want to synchronize state from one environment into another environment.

For example, you may want to synchronize state to a PR environment to run your
code in a more realistic setup.

Or you may want to synchronize a main (production) environment state to a
moduletest environment, if requested by the customer.

## Prerequisites

- A user with access to the relevant project through the
[Lagoon UI](https://ui.lagoon.dplplat01.dpl.reload.dk/)

If you have access to the dpl-platform setup and can run task in the taskfile
(for platform engineers, not developers of the CMS) you may want to synchronize
site state using the related task (runbook WIP).

## Procedure

1. Go to the [Lagoon UI] website and log in
2. Navigate to the relevant project by selecting in the list
3. Pick the *target* environment in the list of environments. E.g. if you are
synchronizing state from `main` to `pr-775` you should select `pr-775`.
4. In the left-hand side pick the "Tasks" menu point

Now you are at the tasks UI and can execute tasks for this environment. It
should look something like this:

![Tasks page in the Lagoon UI](../images/lagoon-ui-tasks-page.png)

Now we need to execute 3 tasks to synchronize the whole state and make it
available on visits to the target site:

<!-- markdownlint-disable-next-line MD029 -->
5. Run task "Copy database between environments \[drush sql-sync\]":

- Select the task in the "Select a task..." dropdown.
- Select the source environment. E.g. if you are synchronizing from `main` to
`pr-775` select `main` in the dropdown.
- Click "Run task" to start the task.
The task appears in the top of the list of tasks. You can click it to see
log output. Once the task completes verify that the log output states that
the synchronization worked.

<!-- markdownlint-disable-next-line MD029 -->
6. Run task "Copy files between environments \[drush rsync\]":

- Select the task in the "Select a task..." dropdown.
- Select the source environment as above.
- Click "Run task" to start the task.
The task output can be viewed as described in point 5.
The task will fail. Verify that the error is a list of statements saying
`> rsync: [receiver] failed to set times on ...`. As long as these are the
only errors in the output, the synchronization succeeded.

<!-- markdownlint-disable-next-line MD029 -->
7. Run task "Clear Drupal caches \[drupal cache-clear\]" to clear the caches:

- Select the task in the "Select a task..." dropdown.
- Select the source environment as above.
- Click "Run task" to start the task.
Once the task completes the environment has been fully synced and caches
are cleared so the state will be reflected when you visit the site.
E.g. if you were synchronizing state from `main` to `pr-775`, the `pr-775`
environment will now have the same state as `main`.
11 changes: 7 additions & 4 deletions docs/runbooks/upgrading-aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ for background info on this operation.
aware that the admin node-pool where harbor runs has a tendency to take a
long time as the harbor pvcs are slow to migrate to the new node.

Monitor via eg.
Monitor via eg.

```shell
watch -n 5 kubectl get nodes
```
```shell
watch -n 5 kubectl get nodes
```

5. Go to `dplsh's` Dockerfile and update the `KUBECTL_VERSION` version to
match that of the upgraded AKS version
9 changes: 9 additions & 0 deletions infrastructure/.dplsh.profile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ fi
export DNSIMPLE_ACCOUNT="61014"

export DPLPLAT_ENV="dplplat01"

# Get bash completion and set the alias and set completion for the alias
source <(kubectl completion bash)
alias kc=kubectl
complete -o default -F __start_kubectl kc

# Give PS1 some color so it's eaiser to find
export PS1='\[$(printf "\x1b[38;2;255;100;250m\]$(hostname):$(pwd)$ \[\x1b[0m")\]'

echo
echo "Environment is assumed to be 'dplplat01'"
echo "If you want to operate another environment, run 'export DPLPLAT_ENV=<environment>'"
Expand Down
Loading

0 comments on commit a2eae7d

Please sign in to comment.