Skip to content

Commit 22eef0f

Browse files
authored
chore: apl-core transfer (#1639)
1 parent bfe3510 commit 22eef0f

24 files changed

+82
-85
lines changed

.github/workflows/integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ on:
123123
default: 'yes'
124124
env:
125125
CACHE_REGISTRY: ghcr.io
126-
CACHE_REPO: redkubes/otomi-core
126+
CACHE_REPO: linode/apl-core
127127
REPO: otomi/core
128128
GIT_USER: svcAPLBot
129129
SCALEWAY_NODE_TYPE: PRO2-M

.github/workflows/main.yml

+21-24
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,36 @@ on:
77
- '*'
88
env:
99
CACHE_REGISTRY: ghcr.io
10-
CACHE_REPO: redkubes/otomi-core
10+
CACHE_REPO: linode/apl-core
1111
REPO: otomi/core
12-
GIT_USER: redkubesbot
1312

1413
jobs:
1514
build-test-cache:
1615
if: (!contains(github.event.head_commit.message, 'ci skip') && !startsWith(github.ref, 'refs/tags/') && !github.event.act)
1716
runs-on: ubuntu-latest
1817
env:
1918
COMMIT_MSG: ${{ github.event.head_commit.message }}
19+
BOT_EMAIL: ${{ vars.BOT_EMAIL }}
20+
BOT_USERNAME: ${{ vars.BOT_USERNAME }}
2021
steps:
2122
- name: Set env
2223
run: |
2324
tag=${GITHUB_REF##*/}
2425
echo "Creating tag: $tag"
2526
echo "TAG=$tag" >> $GITHUB_ENV
26-
git config --global user.email [email protected]
27-
git config --global user.name $GIT_USER
27+
git config --global user.email $BOT_EMAIL
28+
git config --global user.name $BOT_USERNAME
29+
2830
- name: Checkout
2931
uses: actions/checkout@v4
30-
# - name: CI tests, image build and push tag for main or branch
31-
# uses: whoan/docker-build-with-cache-action@v5
32-
# with:
33-
# username: ${{ env.GIT_USER }}
34-
# password: '${{ secrets.NPM_TOKEN }}'
35-
# registry: ${{ env.CACHE_REGISTRY }}
36-
# image_name: ${{ env.CACHE_REPO }}
37-
# image_tag: ${{ env.TAG }}
38-
# pull_image_and_stages: true
3932
- name: Set up Docker Buildx
4033
uses: docker/setup-buildx-action@v3
4134
- name: Login to Github Packages
4235
uses: docker/login-action@v3
4336
with:
4437
registry: ${{ env.CACHE_REGISTRY }}
45-
username: ${{ env.GIT_USER }}
46-
password: '${{ secrets.NPM_TOKEN }}'
38+
username: ${{ env.BOT_USERNAME }}
39+
password: '${{ secrets.BOT_TOKEN }}'
4740
- name: CI tests, image build and push tag for main or branch
4841
uses: docker/build-push-action@v5
4942
with:
@@ -55,11 +48,15 @@ jobs:
5548
needs: build-test-cache
5649
if: always() && ((contains(needs.build-test-cache.result, 'success') && !contains(needs.integration.outputs.started, 'true')) || (contains(needs.integration.result, 'success'))) && !github.event.act
5750
runs-on: ubuntu-latest
51+
env:
52+
BOT_EMAIL: ${{ vars.BOT_EMAIL }}
53+
BOT_USERNAME: ${{ vars.BOT_USERNAME }}
5854
steps:
5955
- name: Push to docker hub
6056
run: |
57+
set -u
6158
TAG=${GITHUB_REF##*/}
62-
docker login -u $GIT_USER -p '${{ secrets.NPM_TOKEN }}' ghcr.io
59+
docker login ghcr.io -u $BOT_USERNAME -p ${{ secrets.BOT_TOKEN }}
6360
image="$CACHE_REGISTRY/$CACHE_REPO:$TAG"
6461
docker pull $image
6562
docker tag $image $REPO:$TAG
@@ -80,8 +77,8 @@ jobs:
8077
uses: actions/checkout@v4
8178
- name: Set env
8279
run: |
83-
git config --global user.email $[email protected]
84-
git config --global user.name $GIT_USER
80+
git config --global user.email $BOT_EMAIL
81+
git config --global user.name $BOT_USERNAME
8582
- name: Create and push git tag
8683
id: git_tag
8784
run: |
@@ -95,10 +92,10 @@ jobs:
9592
echo "Releasing $REPO:$release_tag"
9693
docker tag $REPO:$TAG $REPO:$release_tag
9794
docker push $REPO:$release_tag
98-
docker login -u $GIT_USER -p '${{ secrets.NPM_TOKEN }}' ghcr.io
95+
docker login -u $BOT_USERNAME -p '${{ secrets.BOT_TOKEN }}' ghcr.io
9996
docker tag $REPO:$TAG $CACHE_REGISTRY/$CACHE_REPO:$release_tag
10097
docker push $CACHE_REGISTRY/$CACHE_REPO:$release_tag
101-
echo "machine github.com login $GIT_USER password ${{ secrets.GIT_PASSWORD }}" > ~/.netrc
98+
echo "machine github.com login ${{ env.BOT_USERNAME }} password ${{ secrets.BOT_TOKEN }}" > ~/.netrc
10299
git tag -am "$COMMIT_MSG" $release_tag && git push --follow-tags
103100
#Cut the CHANGELOG.md file up to the first occurence of the "### \[[0-9]*" (meaning three #, a space,a square bracket and any number after it)
104101
sed -n '/### \[[0-9]*/q;p' CHANGELOG.md > NEW_CHANGELOG.md
@@ -125,7 +122,7 @@ jobs:
125122
id: prepare_chart
126123
run: |
127124
# Install and update helm repo
128-
helm repo add otomi https://otomi.io/otomi-core
125+
helm repo add otomi https://otomi.io/apl-core
129126
helm repo update
130127
131128
# Retrieve the app version from package.json
@@ -164,8 +161,8 @@ jobs:
164161
npx js-yaml values-schema.yaml > chart/otomi/values.schema.json
165162
166163
# Set the global id for git as it seems needed by the next step when a custom image is used
167-
git config --global user.email $[email protected]
168-
git config --global user.name $GIT_USER
164+
git config --global user.email ${{ env.BOT_EMAIL }}
165+
git config --global user.name ${{ env.BOT_USERNAME }}
169166
- name: Create and publish otomi chart release
170167
id: chart_release
171168
uses: helm/[email protected]
@@ -194,7 +191,7 @@ jobs:
194191
- name: Pulling the helm chart
195192
run: |
196193
# Install and update helm repo
197-
helm repo add otomi https://otomi.io/otomi-core
194+
helm repo add otomi https://otomi.io/apl-core
198195
helm repo update
199196
200197
# Get latest version of otomi

.values/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Part of Otomi Container Platform.
44

5-
Repo that holds cluster configuration to be used by [otomi-core](https://github.com/redkubes/otomi-core).
5+
Repo that holds cluster configuration to be used by [apl-core](https://github.com/linode/apl-core).
66

77
Please read the online [otomi documentation](https://otomi.io/) for instructions on how to work with the platform.

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ Otomi has been acquired by <a href="https://www.linode.com/otomi/">Akamai</a>. W
1010
</h3>
1111

1212
<p align="center">
13-
<a href="https://github.com/redkubes/otomi-core/releases/"><img alt="Releases" src="https://img.shields.io/github/release-date/redkubes/otomi-core?label=latest%20release" /></a>
14-
<a href="https://img.shields.io/github//redkubes/otomi-core/actions/workflows/main.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/redkubes/otomi-core/main.yml" /></a>
15-
<a href="https://img.shields.io/github/last-commit/redkubes/otomi-core"><img alt="Last commit" src="https://img.shields.io/github/last-commit/redkubes/otomi-core" /></a>
13+
<a href="https://github.com/linode/apl-core/releases/"><img alt="Releases" src="https://img.shields.io/github/release-date/linode/apl-core?label=latest%20release" /></a>
14+
<a href="https://img.shields.io/github//linode/apl-core/actions/workflows/main.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/linode/apl-core/main.yml" /></a>
15+
<a href="https://img.shields.io/github/last-commit/linode/apl-core"><img alt="Last commit" src="https://img.shields.io/github/last-commit/linode/apl-core" /></a>
1616
<a href="https://img.shields.io/crates/l/ap"><img alt="License" src="https://img.shields.io/crates/l/ap" /></a>
1717
<a href="https://img.shields.io/badge/contributions-welcome-orange.svg"><img alt="Contributions" src="https://img.shields.io/badge/contributions-welcome-orange.svg" /></a>
1818
<a href="http://otomi.io/"><img src="https://img.shields.io/website-up-down-green-red/http/shields.io.svg" alt="Website otomi.io"></a>
1919
<a href="https://join.slack.com/t/otomi/shared_invite/zt-1axa4vima-E~LHN36nbLR~ay5r5pGq9A"><img src="https://img.shields.io/badge/slack--channel-blue?logo=slack"></a>
2020
</p>
2121

22-
<p align="center"><img src="https://github.com/redkubes/otomi-core/blob/main/docs/img/otomi-console.png/?raw=true" width="100%" align="center" alt="Otomi integrated applications"></p>
22+
<p align="center"><img src="https://github.com/linode/apl-core/blob/main/docs/img/otomi-console.png/?raw=true" width="100%" align="center" alt="Otomi integrated applications"></p>
2323

2424
<h4 align="center">
2525
Otomi turns any Kubernetes cluster into an Application Platform to provide paved roads from code to production
@@ -42,7 +42,7 @@ To install Otomi, make sure to have a K8s cluster running with at least:
4242
Add the Helm repository:
4343

4444
```bash
45-
helm repo add otomi https://otomi.io/otomi-core
45+
helm repo add otomi https://otomi.io/apl-core
4646
helm repo update
4747
```
4848

@@ -147,15 +147,15 @@ If you wish to contribute please read our [Contributor Code of Conduct](https://
147147

148148
If you want to say **thank you** or/and support the active development of Otomi:
149149

150-
- [Star](https://github.com/redkubes/otomi-core) the Otomi project on Github
150+
- [Star](https://github.com/linode/apl-core) the Otomi project on Github
151151
- Feel free to write articles about the project on [dev.to](https://dev.to/), [medium](https://medium.com/) or on your personal blog and share your experiences
152152

153153
This project exists thanks to all the people who have contributed
154154

155-
<a href="https://github.com/redkubes/otomi-core/graphs/contributors">
156-
<img src="https://contrib.rocks/image?repo=redkubes/otomi-core" />
155+
<a href="https://github.com/linode/apl-core/graphs/contributors">
156+
<img src="https://contrib.rocks/image?repo=linode/apl-core" />
157157
</a>
158158

159159
## License
160160

161-
Otomi is licensed under the [Apache 2.0 License](https://github.com/redkubes/otomi-core/blob/main/LICENSE).
161+
Otomi is licensed under the [Apache 2.0 License](https://github.com/linode/apl-core/blob/main/LICENSE).

adr/index.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Architectural Decision Log
22

3-
This log lists the architectural decisions for otomi-core.
3+
This log lists the architectural decisions for apl-core.
44

55
<!-- adrlog -- Regenerate the content by using "npm run adr". -->
66

7-
* [ADR-2020-10-01](2020-10-01-github-workflow.md) - Our GitHub workflow
8-
* [ADR-2020-10-02](2020-10-02-docker-compose.md) - docker compose
9-
* [ADR-2020-11-06](2020-11-06-bash-style-guide.md) - Bash coding standard
10-
* [ADR-2020-11-06](2020-11-06-konstraint-policy-library.md) - Konstraint library to support Common Rego Language definitions
11-
* [ADR-2021-10-18](2021-10-18-defaults-and-derived.md) - Derived values
12-
* [ADR-2021-10-28](2021-10-28-internal-values.md) - Internal values
13-
* [ADR-2022-03-24](2022-03-24-custom-ca.md) - urice:
14-
* [ADR-2022-04-22](2022-04-22-values-migration.md) - Values migration
15-
* [ADR-2022-04-23](2022-04-23-pre-upgrade.md) - A new otomi pre-upgrade command
16-
* [ADR-2022-05-17](2022-05-17-destroy-upon-uninstall.md) - Extra flags to accomodate destroy upon uninstall
17-
* [ADR-2022-06-07](2022-06-07-ingress-classes.md) - Ingress classes
18-
* [ADR-2022-07-02](2022-07-02-node-affinity.md) - Node affinity
19-
* [ADR-2022-08-26](2022-08-26-other-dns-provider.md) - Other DNS provider
7+
- [ADR-2020-10-01](2020-10-01-github-workflow.md) - Our GitHub workflow
8+
- [ADR-2020-10-02](2020-10-02-docker-compose.md) - docker compose
9+
- [ADR-2020-11-06](2020-11-06-bash-style-guide.md) - Bash coding standard
10+
- [ADR-2020-11-06](2020-11-06-konstraint-policy-library.md) - Konstraint library to support Common Rego Language definitions
11+
- [ADR-2021-10-18](2021-10-18-defaults-and-derived.md) - Derived values
12+
- [ADR-2021-10-28](2021-10-28-internal-values.md) - Internal values
13+
- [ADR-2022-03-24](2022-03-24-custom-ca.md) - urice:
14+
- [ADR-2022-04-22](2022-04-22-values-migration.md) - Values migration
15+
- [ADR-2022-04-23](2022-04-23-pre-upgrade.md) - A new otomi pre-upgrade command
16+
- [ADR-2022-05-17](2022-05-17-destroy-upon-uninstall.md) - Extra flags to accomodate destroy upon uninstall
17+
- [ADR-2022-06-07](2022-06-07-ingress-classes.md) - Ingress classes
18+
- [ADR-2022-07-02](2022-07-02-node-affinity.md) - Node affinity
19+
- [ADR-2022-08-26](2022-08-26-other-dns-provider.md) - Other DNS provider
2020

2121
<!-- adrlogstop -->
2222

binzx/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# How to use the new otomi cli
22

33
```sh
4-
# In the otomi-core directory
4+
# In the apl-core directory
55
export DOCKER_TAG=binzx
66
docker build --target prod -t otomi/core:binzx .
77
./binzx/otomi <commands here>

binzx/installer

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
readonly script=otomi
44
readonly current_branch=$(git rev-parse --abbrev-ref HEAD)
55
readonly branch=${OTOMI_TAG:-$current_branch}
6-
readonly remote=https://raw.githubusercontent.com/redkubes/otomi-core/$branch/binzx/$script
6+
readonly remote=https://raw.githubusercontent.com/linode/apl-core/$branch/binzx/$script
77
readonly path=/usr/local/bin
88

99
readonly msg="Please choose the default install location [$path]: "

binzx/otomi

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#####################################################################################
33
##
44
## NOTE:
5-
## This is a command line tool to operate on otomi-core.
5+
## This is a command line tool to operate on apl-core.
66
## All commands are executed in docker container.
77
## Keep this file as simple as possible:
88
## - do not depend on any external files.
99
## - do not use any non standard tooling.
10-
## - only Docker is needed to run otomi-core image
10+
## - only Docker is needed to run apl-core image
1111
## If you need to use any extra binaries then most probably you want to add them to the otomi/tools image.
1212
##
1313
#####################################################################################
@@ -97,7 +97,7 @@ if [[ ${BASH_SOURCE[0]} == '/'* ]]; then
9797
script_full_path="${BASH_SOURCE[0]}"
9898
fi
9999
readonly script_full_path
100-
update_base="https://raw.githubusercontent.com/redkubes/otomi-core/${otomi_branch_or_tag}/binzx/otomi"
100+
update_base="https://raw.githubusercontent.com/linode/apl-core/${otomi_branch_or_tag}/binzx/otomi"
101101

102102
function date_to_format() {
103103
date=${1:-'1970-01-01T00:00:00Z'}
@@ -164,7 +164,7 @@ check_update() {
164164
[[ $calling_args == *'-ni'* ]]; then
165165
return 0
166166
fi
167-
last_commit_date=$(curl -s "https://api.github.com/repos/redkubes/otomi-core/commits?sha=${otomi_branch_or_tag}&path=binzx%2Fotomi&page=1&per_page=1" | grep -A5 '"committer":' | grep '"date":' | awk -F': ' '{print $2}' | tr -d '"')
167+
last_commit_date=$(curl -s "https://api.github.com/repos/linode/apl-core/commits?sha=${otomi_branch_or_tag}&path=binzx%2Fotomi&page=1&per_page=1" | grep -A5 '"committer":' | grep '"date":' | awk -F': ' '{print $2}' | tr -d '"')
168168
last_file_change=$(date -u -r $script_full_path '+%Y-%m-%dT%H:%M:%SZ')
169169
last_commit_date_sec=$(date_to_format $last_commit_date)
170170
last_file_change_sec=$(date_to_format $last_file_change)
@@ -307,7 +307,7 @@ fi
307307

308308
mkdir -p /tmp/otomi
309309
# Issue arises due to OSX not assuming UTF-8 format: https://unix.stackexchange.com/a/64905 need to set LC_ALL=C
310-
container_name="otomi-core-$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)"
310+
container_name="apl-core-$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)"
311311

312312
if [ "${IN_DOCKER,,}" == "false" ]; then
313313
silent echo $cmd

chart/otomi/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ keywords:
1919
- metrics
2020
- tracing
2121
sources:
22-
- https://github.com/redkubes/otomi-core
22+
- https://github.com/linode/apl-core

docs/development.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Effective development starts with an understanding the code structure and the re
1717
## Project structure
1818

1919
```
20-
otomi-core
20+
apl-core
2121
├── .values # Boilerplate for initializing git repository
2222
├── adr # Architectural Decision Records [read more](https://adr.github.io/madr/)
2323
├── bin # Otomi CLI entrypoint (deprecated)
@@ -44,7 +44,7 @@ otomi-core
4444
It is important that you get familiar with reusable code snippets located at `helmfile.d/snippets`. Below, I describe the most essential ones:
4545

4646
```
47-
otomi-core/helmfile.d/snippets
47+
apl-core/helmfile.d/snippets
4848
├── defaults.yaml # static defaults that can be overwritten by user values and/or derived values
4949
├── derived.gotmpl # values derived from default and user values
5050
├── env.gotmpl # define helmfile environment settings
@@ -141,7 +141,7 @@ In the [Code structure](#Code-structure) chapter, you have learned about reusabl
141141

142142
> We present `myapp` integration. The `myapp` is an arbitrary name and can be anything else.
143143
144-
> A core apps are those defined in otomi-core. Do not confuse them with team services, which are defined in the values repo.
144+
> A core apps are those defined in apl-core. Do not confuse them with team services, which are defined in the values repo.
145145
146146
## Using the default code snippet
147147

@@ -316,11 +316,11 @@ TBD
316316

317317
## Using CLI while developing templates
318318

319-
Using Otomi CLI can be very helpful while integrating apps or developing new features that involve the execution of Helmfile because it allows you to render and validate manifests. It is possible to use Otomi CLI in development mode, so the Otomi CLI reflects changes made in your local `otomi-core` directory.
319+
Using Otomi CLI can be very helpful while integrating apps or developing new features that involve the execution of Helmfile because it allows you to render and validate manifests. It is possible to use Otomi CLI in development mode, so the Otomi CLI reflects changes made in your local `apl-core` directory.
320320

321321
To run Otomi CLI in the development mode, you must:
322322

323-
- execute Otomi CLI commands from a root directory of the `otomi-core` project
323+
- execute Otomi CLI commands from a root directory of the `apl-core` project
324324
- export `ENV_DIR`
325325

326326
First, run `npm install` to build all modules required for CLI.

docs/migrating-values.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Assumptions/conventions used in this document:
44

5-
- `otomi-values` is a git repo with values bootstrapped by a version of an `otomi-core` container.
5+
- `otomi-values` is a git repo with values bootstrapped by a version of an `apl-core` container.
66

77
### The problem
88

@@ -13,11 +13,11 @@ We break the schema (`values-schema.yaml`) in our `otomi-values` when:
1313
- We move props around
1414
- We mutate a property's type and/or it's value shape
1515

16-
In order to move to another version of `otomi-core` (which might contain some of these changes), we needed a mechanism that migrates the old `otomi-values` to conform to the new schema. So we came up with a simple approach that serves our simple schema.
16+
In order to move to another version of `apl-core` (which might contain some of these changes), we needed a mechanism that migrates the old `otomi-values` to conform to the new schema. So we came up with a simple approach that serves our simple schema.
1717

1818
### Solution
1919

20-
By comparing the diff between the old and the new schema a developer is able to create change records in `otomi-core` and store them in `values-changes.yaml`. Each record is given a successive number. If a user wants to upgrade the platform to a newer version of `otomi-core`, these change records will have to be applied to the values in successive order. When a dev runs `otomi commit` in an `otomi-values` repo, changes made to `otomi.version` will be detected, and the migration script will run in the newer container. The script only needs to compare the new `version` in `values-schema.yaml` with the `version` found in `otomi-values`.
20+
By comparing the diff between the old and the new schema a developer is able to create change records in `apl-core` and store them in `values-changes.yaml`. Each record is given a successive number. If a user wants to upgrade the platform to a newer version of `apl-core`, these change records will have to be applied to the values in successive order. When a dev runs `otomi commit` in an `otomi-values` repo, changes made to `otomi.version` will be detected, and the migration script will run in the newer container. The script only needs to compare the new `version` in `values-schema.yaml` with the `version` found in `otomi-values`.
2121

2222
### Change records
2323

@@ -72,7 +72,7 @@ changes:
7272

7373
### Workflow
7474

75-
Every time a developer changes the schema (`values-schema.yaml`) and adds change records, the `otomi migrate` command should be performed that will migrate the values to the new structure. For the following example workflow, we assume that the current (new) schema version of `otomi-core` is `4`, and the previous `otomi-values` version is at `3`.
75+
Every time a developer changes the schema (`values-schema.yaml`) and adds change records, the `otomi migrate` command should be performed that will migrate the values to the new structure. For the following example workflow, we assume that the current (new) schema version of `apl-core` is `4`, and the previous `otomi-values` version is at `3`.
7676

7777
Note:
7878

0 commit comments

Comments
 (0)