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

Pull Request - CI/CD Part 2 Pipeline to Sandbox- Digital Dreamers #101

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

xinpengwoo
Copy link

@xinpengwoo xinpengwoo commented Aug 31, 2024

Summary

Th CI/CD pipeline created using a YAML configuration automates the process of building, testing, and deploying your application to Google Cloud Run, ensuring a streamlined and secure deployment process.

Changes

  • One file added: ci-cd.yml (Location: .github/workflows/ci-cd.yml)
  • Change made in the requirements.txt. ‘Fastapi’ changed to ‘fastapi[standard]'
  • Activated GitHub actions for the repo for CI/CD deployment.

Testing

  • Setting Up GitHub Actions and Configuring GCP Cloud Run: GitHub Actions was activated for the code repository for the first time. As part of the setup, the Google Cloud Run API was enabled to allow deployment of the application. Additionally, a Google Cloud service account was created, and its JSON key was securely stored as a GitHub Secret (GOOGLE_CREDENTIAL) to authenticate the deployment process.

  • Triggering the YAML file through GitHub Actions: The ‘ci-cd.yml’ file triggers the workflow for the pipeline with continuous integration and deployment. Each time a new pull request is made and closed on staging branch, continuous integration/deployment is triggered using GitHub actions.

Results

The pipeline passes all the tests, and the repo can complete CI/CD process.
Screenshot 2024-08-31 at 09 22 49

Notes

  • This CI/CD pipeline automates the process of building, testing, and deploying your application, ensuring a reliable and secure deployment to Google Cloud Run. You can maintain and troubleshoot the pipeline effectively by following the steps outlined in the documentation.
  • Documentation: CI/CD Part 2: Pipeline to Sandbox

Screenshots

Screenshot 2024-09-07 at 12 36 11 Screenshot 2024-09-07 at 12 36 24

@xinpengwoo xinpengwoo closed this Aug 31, 2024
@xinpengwoo xinpengwoo reopened this Aug 31, 2024
@xinpengwoo xinpengwoo closed this Aug 31, 2024
@xinpengwoo xinpengwoo reopened this Aug 31, 2024
Copy link
Collaborator

@huzaifakhan04 huzaifakhan04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@huzaifakhan04
Copy link
Collaborator

@hash2004 Kindly review this and share any further feedback you may have!

Copy link
Collaborator

@hash2004 hash2004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super clean code! Good job. Please see the review. Thanks!

Dockerfile Outdated
@@ -16,4 +16,4 @@ COPY ./app /code/app

ENV PYTHONPATH=/code/app

CMD ["fastapi", "dev", "app/main.py", "--host=0.0.0.0", "--port=8000"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are currently using port 8000 for our backend. Could you clarify why we are using port 8080 here? Other than that, good job! Super clean :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the mistake. I initially thought that google cloud port 8000 was a default variable that could not be modified. Following the Google Cloud Run documentation, I set the port parameter by --port 8000 in gcloud run deploy and reverted the Dockerfile to its previous state. The changes have passed the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants