-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add terraform code for testing purpose #24
Draft
passionne
wants to merge
3
commits into
master
Choose a base branch
from
feat/add_terraform_code_for_testing_purpose
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passionne
force-pushed
the
feat/add_terraform_code_for_testing_purpose
branch
from
July 24, 2024 20:53
33620b1
to
79f7d1e
Compare
passionne
added a commit
that referenced
this pull request
Jul 31, 2024
How to test the fix: Using the terraform code from PR #24: * build local RPMs for two versions: ---- cd apim/4.x/ mkdir -p rpms/4.{3.1,4.3} ./build.sh -v 4.3.1 rm graviteeio-apim-4x-4.3.1-1.noarch.rpm mv *.rpm rpms/4.3.1/ ./build.sh -v 4.4.3 rm graviteeio-apim-4x-4.4.3-1.noarch.rpm mv *.rpm rpms/4.4.3/ ---- * then run a redhat 9 VM in Azure: ---- cd ../../test/terraform_linux_vm/redhat export TF_VAR_allowed_ips="$(curl -s 'https://ipv4.seeip.org')" export TF_VAR_username=graviteeio terraform apply -auto-approve ---- * copy your local RPMs to the remote machine following connexion instruction as output from terraform ---- scp ... -r ../../../apim/4.x/rpms graviteeio@<VM ip>:. ---- * connect to the VM with ssh following instruction from terraform output and get into current tmux session ---- ssh .... graviteeio@<VM ip> tmux attach ---- * install first version of built RPMs: ---- ./install_redhat_graviteeio.sh install_graviteeio_from_local_rpms rpms/4.3.1/ ---- * check that APIM works as expected: ** from the remote machine via ./install_redhat_graviteeio.sh test_graviteeio ** by using SSH tunnet from your browser in http://localhost:8084/ for the console (user/pass == admin/admin) and to the portal with http://localhost:8085/ * do the upgrade in VM: ---- for rpm in rpms/4.4.3/*.rpm; do sudo yum upgrade -y "${rpm}"; done sudo systemctl daemon-reload sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api sleep 45 #wait backend start sudo systemctl restart nginx ---- * check again that console and portal continue to work as expected. Note, the reproduce the issue, rather than local RPM install, do: ---- ./install_redhat_graviteeio.sh install_graviteeio_from_repository 4.3.1 ---- check all good and then: ---- sudo yum upgrade -y "graviteeio-apim-4x-4.4.3" sudo systemctl daemon-reload sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api sleep 45 #wait backend start sudo systemctl restart nginx ---- Now console still works, but portal is broken. TT-4996 APIM-6148
passionne
added a commit
that referenced
this pull request
Aug 1, 2024
How to test the fix: Using the terraform code from PR #24: * build local RPMs for two versions: ---- cd apim/4.x/ mkdir -p rpms/4.{3.1,4.3} ./build.sh -v 4.3.1 rm graviteeio-apim-4x-4.3.1-1.noarch.rpm mv *.rpm rpms/4.3.1/ ./build.sh -v 4.4.3 rm graviteeio-apim-4x-4.4.3-1.noarch.rpm mv *.rpm rpms/4.4.3/ ---- * then run a redhat 9 VM in Azure: ---- cd ../../test/terraform_linux_vm/redhat export TF_VAR_allowed_ips="$(curl -s 'https://ipv4.seeip.org')" export TF_VAR_username=graviteeio terraform apply -auto-approve ---- * copy your local RPMs to the remote machine following connexion instruction as output from terraform ---- scp ... -r ../../../apim/4.x/rpms graviteeio@<VM ip>:. ---- * connect to the VM with ssh following instruction from terraform output and get into current tmux session ---- ssh .... graviteeio@<VM ip> tmux attach ---- * install first version of built RPMs: ---- ./install_redhat_graviteeio.sh install_graviteeio_from_local_rpms rpms/4.3.1/ ---- * check that APIM works as expected: ** from the remote machine via ./install_redhat_graviteeio.sh test_graviteeio ** by using SSH tunnet from your browser in http://localhost:8084/ for the console (user/pass == admin/admin) and to the portal with http://localhost:8085/ * do the upgrade in VM: ---- for rpm in rpms/4.4.3/*.rpm; do sudo yum upgrade -y "${rpm}"; done sudo systemctl daemon-reload sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api sleep 45 #wait backend start sudo systemctl restart nginx ---- * check again that console and portal continue to work as expected. Note, the reproduce the issue, rather than local RPM install, do: ---- ./install_redhat_graviteeio.sh install_graviteeio_from_repository 4.3.1 ---- check all good and then: ---- sudo yum upgrade -y "graviteeio-apim-4x-4.4.3" sudo systemctl daemon-reload sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api sleep 45 #wait backend start sudo systemctl restart nginx ---- Now console still works, but portal is broken. TT-4996 APIM-6148
passionne
force-pushed
the
feat/add_terraform_code_for_testing_purpose
branch
from
November 20, 2024 15:22
79f7d1e
to
9da3860
Compare
wbabyte
approved these changes
Nov 26, 2024
sudo sed -i "/\"baseURL\": /{s#\"baseURL\": \".*\"#\"baseURL\": \"http://${public_ip}:8083/portal\"#}" /opt/graviteeio/apim/portal-ui/assets/config.json | ||
} | ||
|
||
install_graviteeio_from_repository(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should also implement upgrade? I had to manually run sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api to apply upgrade after I run install_graviteeio_from_repository with the new version. Not sure about UI though I only restarted BE services
* create a VM with OS: ** RedHat 8/9 ** Centos Stream 9 ** Centos 7 ** Suze * can be accessible only from our IP on SSH port (22) * ephemeral SSH key was generated * with included script to make multiple installation easier: ** install all gravitee prerequisites (java, mongo, elastic) ** install all gravitee from artifact hub repo with specific version ** install all gravitee from built RPMs ** configure everything to make it works by default from SSH tunnel * install script is enforced and can be used for non regression test TODO to improve: @see todo section in documentation.
* fix rpm hook script and cleanup + backward compatibility of version detection APIM-7660 APIM-4892 TT-6090 TT-6333
* align nginx configuration with what is it use in dockerized environment. * process 404 error pages APIM-8401 TT-4746
passionne
force-pushed
the
feat/add_terraform_code_for_testing_purpose
branch
from
January 21, 2025 00:09
8c0e4cc
to
8ff2c71
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress PR
The goal is to provide terraform code which trigger a VM
and make any test of RPM installation or upgrade easier.