Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.1.4] Merging from develop branch to prod branch #237

Merged
merged 28 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
632d738
chore(deps): update actions/checkout action to v4
renovate[bot] Sep 8, 2023
af52ec0
chore(deps): update registry.fedoraproject.org/fedora docker tag to v39
renovate[bot] Sep 13, 2023
ffcdcdb
chore(deps): automated dependency updates
renovate[bot] Sep 18, 2023
7b36d2c
chore(deps): automated dependency updates
renovate[bot] Sep 25, 2023
5213dc9
chore(deps): automated dependency updates
renovate[bot] Oct 2, 2023
fe21a40
chore(deps): automated dependency updates
renovate[bot] Oct 9, 2023
f6d6ee2
Merge pull request #210 from fedora-infra/renovate/actions-checkout-4.x
gridhead Oct 10, 2023
b544794
Include deployment documentation for the application
gridhead Oct 11, 2023
456b918
Merge pull request #223 from fedora-infra/deploydocs
gridhead Oct 12, 2023
2b73487
chore(deps): automated dependency updates
renovate[bot] Oct 16, 2023
f71cbf1
Add epel9 release
humaton Oct 17, 2023
8bc1fb6
fix(deps): update dependency uvloop to ^0.17.0 || ^0.18.0
renovate[bot] Oct 17, 2023
0b3224f
chore(deps): automated dependency updates
renovate[bot] Oct 23, 2023
0b30ede
Merge pull request #225 from humaton/develop
gridhead Oct 26, 2023
99d91b0
fix(deps): update dependency uvloop to ^0.17.0 || ^0.18.0 || ^0.19.0
renovate[bot] Oct 26, 2023
06a5307
chore(deps): update dependency flake8 to v6
renovate[bot] Oct 27, 2023
3d90089
chore(deps): automated dependency updates
renovate[bot] Oct 30, 2023
42c71b3
chore(deps): automated dependency updates
renovate[bot] Nov 6, 2023
c4d6393
chore(deps): automated dependency updates
renovate[bot] Nov 13, 2023
db7d03b
Merge pull request #203 from fedora-infra/renovate/flake8-6.x
gridhead Nov 15, 2023
e34f329
Merge pull request #190 from fedora-infra/renovate/registry.fedorapro…
gridhead Nov 15, 2023
0465395
Version bump from v3.1.3 to v3.1.4
gridhead Nov 15, 2023
d3410aa
Merge pull request #232 from fedora-infra/versbump
gridhead Nov 15, 2023
7cb1261
Merge pull request #233 from fedora-infra/fl38sd
gridhead Nov 15, 2023
d907b4b
Step down from Fedora Linux 39 to Fedora Linux 38
gridhead Nov 15, 2023
0af3074
Install the most recent version of MDAPI
gridhead Nov 15, 2023
a7b2f99
Merge pull request #235 from fedora-infra/versdock
gridhead Nov 15, 2023
ebaa50e
chore(deps): automated dependency updates
renovate[bot] Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install the base dependencies
run: |
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install the base dependencies
run: |
Expand Down
123 changes: 123 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Deploying MDAPI on OpenShift

## Preparation

1. Clone the `ansible` repository to the local environment.
```
git clone ssh://git@pagure.io/fedora-infra/ansible.git
```
2. Make the necessary changes in the deployment playbook and push them to the repository.
```
nano ansible/playbooks/openshift-apps/mdapi.yml
```
3. Ensure that the project codebase is updated in the target branches for the relevant deployment.
```
git clone https://github.com/gridhead/protop2g.git
```
4. Confirm that the `develop` branch is used for staging and `prod` branch is used for production.

## Deployment

1. While ensuring that the related SSH config are in place, connect to the `batcave01` node using SSH.
```
ssh batcave01
```
2. Execute the following command when connected to the `batcave01` TTY.
For staging,
```
sudo rbac-playbook openshift-apps/mdapi.yml -l staging
```
For production,
```
sudo rbac-playbook openshift-apps/mdapi.yml -l production
```
3. Follow the steps provided in the **Diagnosis** section to check the build and deployment statuses.

## Diagnosis

1. While ensuring that the related SSH config are in place, connect to the following nodes using SSH.
For staging
```
ssh root@os-control01.stg.iad2.fedoraproject.org
```
For production
```
ssh t0xic0der@os-control01.iad2.fedoraproject.org
```
2. Execute the following command to check which user you have logged in as.
```
oc whoami
```
Example output
```
system:admin
```
3. List all the projects using the following projects and filter specifically for the `mdapi` namespace.
```
oc projects | grep mdapi
```
4. List all the builds associated with the `mdapi` project namespace.
```
oc -n mdapi get builds
```
Example output
```
NAME TYPE FROM STATUS STARTED DURATION
mdapi-build-8 Docker Git@bad0092 Failed (DockerBuildFailed) 9 months ago 17s
mdapi-build-9 Docker Git@435fa01 Failed (DockerBuildFailed) 9 months ago 8s
mdapi-build-10 Docker Git@43ddd19 Failed (DockerBuildFailed) 9 months ago 48s
mdapi-build-23 Docker Git@aafb5c4 Failed (DockerBuildFailed) 4 months ago 1m4s
mdapi-build-24 Docker Git@dd81099 Complete 4 months ago 1m44s
mdapi-build-25 Docker Git@fe39071 Complete 2 months ago 2m1s
mdapi-build-26 Docker Git@4081354 Complete 2 months ago 1m56s
mdapi-build-27 Docker Git@4081354 Complete 2 months ago 1m56s
mdapi-build-28 Docker Git@4081354 Complete 2 months ago 2m2s
mdapi-build-29 Docker Git@e32fa9b Cancelled (CancelledBuild) 4 weeks ago 12h9m37s
```
5. List all the pods associated with the `mdapi` project namespace.
```
oc -n mdapi get pods
```
Example output
```
NAME READY STATUS RESTARTS AGE
mdapi-28282100-mvq95 0/1 Completed 0 125m
mdapi-28282160-9xtv4 0/1 Completed 0 65m
mdapi-28282220-hfrzf 0/1 Completed 0 5m4s
mdapi-39-xxxdq 1/1 Running 0 19d
```
6. View all the logs associated with a certain pod in the `mdapi` namespace.
```
oc -n mdapi logs mdapi-39-xxxdq
```
Example output
```
....
[2023-10-10 10:26:50 +0000] [INFO] index <Request GET / >
[2023-10-10 10:27:15 +0000] [INFO] index <Request GET / >
[2023-10-10 10:27:50 +0000] [INFO] index <Request GET / >
[2023-10-10 10:28:15 +0000] [INFO] index <Request GET / >
....
```
7. List the routes associated with the namespace.
```
oc get routes -n mdapi
```
Example output
```
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
mdapi mdapi.stg.fedoraproject.org mdapi 8080-tcp edge/Redirect None
```
8. Get into the TTY of a certain pod.
```
oc -n mdapi rsh mdapi-41-q9m8q
```
Example output
```
sh-5.2$ mdapi --version
mdapi, version 3.1.3
```

## Troubleshooting

Please connect with [Fedora Infrastructure](https://pagure.io/fedora-infrastructure/issues) for more information.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXPOSE 8080
ENV PYTHONUNBUFFERED=1

RUN dnf -y install python3-pip && dnf -y clean all
RUN pip install --upgrade mdapi==3.1.3
RUN pip install --upgrade mdapi==3.1.4

# Uncomment the following MDAPI_CONFIG and comment the other MDAPI_CONFIG for local development builds
# ENV MDAPI_CONFIG=/code/mdapi/confdata/standard.py
Expand Down
3 changes: 3 additions & 0 deletions mdapi/database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ def index_repositories():
elif rels["name"] == "Fedora EPEL" and versdata == "8":
name = repodict["epel"][jndx] % rels["koji_name"]
urli = urli.replace("/x86_64/", "/Everything/x86_64/")
elif rels["name"] == "Fedora EPEL" and versdata == "9":
name = repodict["epel"][jndx] % rels["koji_name"]
urli = urli.replace("/x86_64/", "/Everything/x86_64/")
else:
name = repodict["epel"][jndx] % rels["koji_name"]
rurl = urli % (standard.DL_SERVER, versdata)
Expand Down