- Clone the
ansible
repository to the local environment.git clone ssh://[email protected]/fedora-infra/ansible.git
- Make the necessary changes in the deployment playbook and push them to the repository.
nano ansible/playbooks/openshift-apps/mdapi.yml
- Ensure that the project codebase is updated in the target branches for the relevant deployment.
git clone https://github.com/gridhead/protop2g.git
- Confirm that the
develop
branch is used for staging andprod
branch is used for production.
- While ensuring that the related SSH config are in place, connect to the
batcave01
node using SSH.ssh batcave01
- Execute the following command when connected to the
batcave01
TTY.
For staging,For production,sudo rbac-playbook openshift-apps/mdapi.yml -l staging
Assudo rbac-playbook openshift-apps/mdapi.yml
production
is the default environment, there is no need to state the environment here explicitly. - Follow the steps provided in the Diagnosis section to check the build and deployment statuses.
- While ensuring that the related SSH config are in place, connect to the following nodes using SSH.
For staging For production - Log into your OpenShift account using an internet browser of your choice.
For stagingFor productionhttps://console-openshift-console.apps.ocp.stg.fedoraproject.org/
https://console-openshift-console.apps.ocp.fedoraproject.org/
- Click on the
Copy login command
option from the profile section to obtain the login command.
For staging
For production
- Expose the hidden login command and copy over the login command for your environment.
- Execute the following command to check which user you have logged in as.
Example output
oc whoami
system:admin
- List all the projects using the following projects and filter specifically for the
mdapi
namespace.oc projects | grep mdapi
- List all the builds associated with the
mdapi
project namespace.Example outputoc -n mdapi get builds
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
- List all the pods associated with the
mdapi
project namespace.Example outputoc -n mdapi get pods
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
- View all the logs associated with a certain pod in the
mdapi
namespace.Example outputoc -n mdapi logs mdapi-39-xxxdq
.... [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 / > ....
- List the routes associated with the namespace.
Example output
oc get routes -n mdapi
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD mdapi mdapi.stg.fedoraproject.org mdapi 8080-tcp edge/Redirect None
- Get into the TTY of a certain pod.
Example output
oc -n mdapi rsh mdapi-41-q9m8q
sh-5.2$ mdapi --version mdapi, version 3.1.3
Please connect with Fedora Infrastructure for more information.