Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
f9010c0
Create main.yml
saidinkar Aug 21, 2023
f6f8625
Delete python-app.yml
saidinkar Aug 21, 2023
c6f2117
Updated trigger
saidinkar Aug 21, 2023
d44a043
Update app.py
saidinkar Aug 22, 2023
1f80311
Update requirements.txt
saidinkar Aug 22, 2023
f99d71a
Create python-package-conda.yml
saidinkar Aug 22, 2023
2d9efec
Delete python-package-conda.yml
saidinkar Aug 22, 2023
cc63392
added docker file
Aug 22, 2023
70d8eb2
Create docker-image.yml
saidinkar Aug 22, 2023
6fa9536
added keys to GA
Aug 22, 2023
f22f90e
added keys to GA
Aug 22, 2023
bb57a54
modified the repos
Aug 23, 2023
af77be9
modified Dockerfile
Aug 28, 2023
1759396
renamed Dockerfile
Aug 28, 2023
8478ff3
checking on new workflow
Aug 31, 2023
100b2f5
edited workflow
Aug 31, 2023
2b6a5f9
edited workflow
Aug 31, 2023
2fcc567
changed dockerfile path
Aug 31, 2023
aee0049
changed dockerfile path to Docker
Aug 31, 2023
e18dc31
added docker dir
Aug 31, 2023
03af80a
added dockerfile new
Aug 31, 2023
b53d95c
added dockerfile new
Aug 31, 2023
f37e5e8
added dockerfile path
Aug 31, 2023
2c49718
added dockerfile path
Aug 31, 2023
b4854cc
added dockerfile path
Aug 31, 2023
41d608c
adding Dev
Aug 31, 2023
cdcb279
chnaged pattern dir
Aug 31, 2023
387be9a
docker testing
Aug 31, 2023
729a515
docker build
Aug 31, 2023
22341a8
docker build
Aug 31, 2023
8c9e802
deploying on AKS
Aug 31, 2023
8429164
added main.yml
Sep 1, 2023
33f958c
added files
Sep 1, 2023
a82220f
added AKS deploy
Sep 3, 2023
9d2018c
added env
Sep 3, 2023
7d2d07f
added deploy permissions
Sep 3, 2023
69d10d8
check aks yml
Sep 3, 2023
5ddfe9f
updated main yml
Sep 3, 2023
acf535c
updated main yml 1
Sep 3, 2023
8fe8be1
added azure login
Sep 3, 2023
8ec372d
added azure login
Sep 3, 2023
692934e
set azure context
Sep 3, 2023
9863d85
set kubelogin and k8s secret
Sep 3, 2023
a79b39a
changed the aks env name
Sep 3, 2023
b2b4281
changed secret type
Sep 3, 2023
4425e17
added aks deploy
Sep 3, 2023
5975765
added path of manifest
Sep 3, 2023
6934c7e
edited deploy manifest
Sep 3, 2023
d882a61
edited deploy manifest
Sep 3, 2023
7a3cd29
edited deploy manifest
Sep 4, 2023
9350aa1
edited main.yml k8s
Sep 4, 2023
0e29895
edited deploy path
Sep 4, 2023
02c67ac
edited mainfests path
Sep 4, 2023
41e4505
docker tag
Sep 4, 2023
df0f922
docker tag 1
Sep 4, 2023
d0be9ad
jfrog
Sep 4, 2023
83db9cc
jfrog
Sep 4, 2023
f8f0925
jfrog
Sep 4, 2023
1f5c215
jfrog
Sep 4, 2023
3bede6c
jfrog tag
Sep 4, 2023
cc34a5c
jfrog tagged
Sep 4, 2023
1e8b064
jfrog tagged
Sep 4, 2023
d670701
jfrog tagged 1
Sep 4, 2023
8438c2a
jfrog tagged 2
Sep 4, 2023
939b0d9
jfrog tagged 2
Sep 4, 2023
c0b793d
jfrog tagged 2
Sep 4, 2023
5ceb70a
tagging both jfrog and acr
Sep 4, 2023
de2fcf6
upgraded aks deploy to v4
Sep 4, 2023
5691e5a
added code checkout
Sep 4, 2023
35c6146
added az sp
Sep 4, 2023
1b79229
added az sp
Sep 4, 2023
f624019
added jfrog with aks
Sep 5, 2023
84ad78f
repo restructure
Sep 6, 2023
113e2c9
added the testing parameter
Sep 8, 2023
9115939
added the testing parameter
Sep 8, 2023
95e718a
checking code
Sep 8, 2023
1c6f9a5
testing code by changing values
Sep 8, 2023
215095d
commented python venv
Sep 8, 2023
757afe2
changed path in pylint
Sep 8, 2023
00e4cb1
changed path in pylint
Sep 8, 2023
5956055
changed py version
Sep 8, 2023
331da99
checking flake 8
Sep 11, 2023
f1a8e7b
changed version of python
Sep 11, 2023
cd52b86
changed version of python to 3.x
Sep 11, 2023
6104d6e
added pylint
Sep 11, 2023
058e629
added pylint
Sep 11, 2023
32bceb0
checking lint and pytest
Sep 11, 2023
0992ac6
checking pylint
Sep 11, 2023
fd8a725
checking pylint after fixing the issue
Sep 11, 2023
7d7c0eb
edited test
Sep 11, 2023
39da61c
checking pylint true
Sep 11, 2023
520bafe
added new pipeline for test
Sep 15, 2023
1bb5949
added pytest path
Sep 15, 2023
0dcbfb1
Update Azure_servcie_connection.md
saidinkar Oct 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Global Owners
* @dinkar

# dockerfiles
dockerfiles/** @dinkar

# e2e tests
tests/e2e/** @dinkar

# devworkspace happy path test
tests/devworkspace-happy-path/**
61 changes: 61 additions & 0 deletions .github/workflows/aks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: main
on: workflow_dispatch
env:
ACR_RESOURCE_GROUP: sai-arch
AZURE_CONTAINER_REGISTRY: myacr108
CLUSTER_NAME: my_aks
CLUSTER_RESOURCE_GROUP: sai-arch
CONTAINER_NAME: my-container
DEPLOYMENT_MANIFEST_PATH: |
manifests/deployment.yaml
manifests/service.yaml
jobs:
buildImage:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- name: Build and push image to ACR
run: az acr build --image ${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.ACR_RESOURCE_GROUP }} -f Dockerfile ./
deploy:
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
needs:
- buildImage
steps:
- uses: actions/checkout@v3
- uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- uses: azure/use-kubelogin@v1
name: Set up kubelogin for non-interactive login
with:
kubelogin-version: v0.0.25
- uses: azure/aks-set-context@v3
name: Get K8s context
with:
admin: "false"
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
use-kubelogin: "true"
- uses: Azure/k8s-deploy@v4
name: Deploys application
with:
action: deploy
images: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}
namespace: namespace-workflow-1693722624174
113 changes: 113 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#this pipeline is for python API on Azure Kubernetes Services


name: Build CI

on: workflow_dispatch

# Below environment variables available to all jobs and steps in this workflow
env:
ARTIFACTORY_URL: https://dkregistry.jfrog.io/artifactory/docker/
ARTIFACTORY_NAME: dkregistry
ARTIFACTORY_USERNAME: saidinkargedela97@gmail.com
CONTAINER_NAME: myimage
CLUSTER_NAME: my-aks-cluster
CLUSTER_RESOURCE_GROUP: dinkar-rg
NAMESPACE: default
DEPLOYMENT_MANIFEST_PATH: |
manifests/deployment.yaml
manifests/service.yaml


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

# Connecting to Jfrog Artifactory
- name: Jfrog Artifactory Login
uses: docker/login-action@v1
with:
registry: ${{ env.ARTIFACTORY_NAME }}.jfrog.io
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}

# Docker container build
- name: Docker Build
run: |
echo '<-----------------------Docker build started----------------------->'
docker build . -t dkregistry.jfrog.io/docker/mytestimage:${{ github.sha }}
echo '<------------------------Docker build Ended------------------------>'

# Docker Container Push to ACR
- name: Docker Push
run: |
echo '<-----------------------Docker Publish started----------------------->'
docker push dkregistry.jfrog.io/docker/mytestimage:${{ github.sha }}
echo '<------------------------Docker Publish Ended------------------------>'

Deploy:
permissions:
actions: read
contents: read
id-token: write

runs-on: ubuntu-latest

# Delpoy job won't run until build job is completed
needs: [build]

steps:
# Checks out the repository this file is in
- uses: actions/checkout@v3

- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v1
with:
# Azure credentials i.e. output of
creds: '${{secrets.AZURE_CREDENTIALS}}'
# Resource Group Name
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
# AKS Cluster Name
cluster-name: ${{ env.CLUSTER_NAME }}


# Use kubelogin to configure your kubeconfig for Azure auth
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.25'

# Create K8s secrets to pull images
- name: Create secret in Kubernetes cluster
uses: Azure/k8s-create-secret@v1.1
with:
# Container registry URL
container-registry-url: ${{env.ARTIFACTORY_URL}}
# Container registry username
container-registry-username: '${{ secrets.ARTIFACTORY_USERNAME }}'
# Container registry password
container-registry-password: '${{ secrets.ARTIFACTORY_PASSWORD }}'
# Type of Kubernetes secret. For example, docker-registry or generic
secret-type: docker-registry
# Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.
secret-name: jfrog-image-pull-secret

# Deploy to k8s cluster
- name: Deploy to Kubernetes cluster
uses: Azure/k8s-deploy@v4
with:
# deploy/promote/reject
action: deploy
# Path to the manifest files which will be used for deployment.
manifests: |
${{ env.DEPLOYMENT_MANIFEST_PATH }}
# Fully qualified resource URL of the image(s) to be used for substitutions on the manifest files Example: contosodemo.azurecr.io/helloworld:test
images: |
dkregistry.jfrog.io/docker/mytestimage:${{ github.sha }}
# Name of a docker-registry secret that has already been set up within the cluster. Each of these secret names are added under imagePullSecrets field for the workloads found in the input manifest files
imagepullsecrets: |
acr-image-pull-secret

41 changes: 41 additions & 0 deletions .github/workflows/jfrog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Tag Docker Image

on:
push:
branches:
- workflow_dispatch

jobs:
build-and-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ secrets.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}

- name: Build Tag and push Docker Image
env:
IMAGE_NAME: dkregistry.jfrog.io/docker/jfrog-docker-example-image:${{ github.run_number }}
run: |
jf docker build -t $IMAGE_NAME .
jf docker push $IMAGE_NAME

- name: Publish Build info With JFrog CLI
env:
# Generated and maintained by GitHub
JFROG_CLI_BUILD_NAME: jfrog-docker-build-example
# JFrog organization secret
JFROG_CLI_BUILD_NUMBER : ${{ github.run_number }}
run: |
# Export the build name and build nuber
# Collect environment variables for the build
jf rt build-collect-env
# Collect VCS details from git and add them to the build
jf rt build-add-git
# Publish build info
jf rt build-publish
121 changes: 121 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#this pipeline is for python API on Azure Kubernetes Services

# Set the following environment variables (or replace the values below):
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
# - RESOURCE_GROUP (where your cluster is deployed)
# - CLUSTER_NAME (name of your AKS cluster)
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)


name: Python Flask on Kubernetes

on:
workflow_dispatch:

# Below environment variables available to all jobs and steps in this workflow
env:
REGISTRY_NAME: myacr108
CONTAINER_NAME: my-container
RESOURCE_GROUP: sai-arch
CLUSTER_NAME: my_aks
CLUSTER_RESOURCE_GROUP: sai-arch
NAMESPACE: default
DEPLOYMENT_MANIFEST_PATH: |
manifests/deployment.yaml
manifests/service.yaml

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@master

# Connecting to Azure Container registry (ACR)
- name: ACR Login
uses: azure/docker-login@v1
with:
login-server: ${{ env.REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

# Docker container build
- name: Docker Build
run: |
echo '<-----------------------Docker build started----------------------->'
docker build . -t ${{ env.REGISTRY_NAME }}.azurecr.io/${{env.CONTAINER_NAME}}:${{ github.sha }}
echo '<------------------------Docker build Ended------------------------>'

# Docker Container Push to ACR
- name: Docker Push
run: |
echo '<-----------------------Docker Publish started----------------------->'
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/${{env.CONTAINER_NAME}}:${{ github.sha }}
echo '<------------------------Docker Publish Ended------------------------>'

Deploy:
permissions:
actions: read
contents: read
id-token: write

runs-on: ubuntu-latest

# Delpoy job won't run until build job is completed
needs: [build]

steps:
# Checks out the repository this file is in
- uses: actions/checkout@v3

- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v1
with:
# Azure credentials i.e. output of
creds: '${{secrets.AZURE_CREDENTIALS}}'
# Resource Group Name
resource-group: ${{ env.RESOURCE_GROUP }}
# AKS Cluster Name
cluster-name: ${{ env.CLUSTER_NAME }}


# Use kubelogin to configure your kubeconfig for Azure auth
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.25'

# Create K8s secrets to pull images
- name: Create secret in Kubernetes cluster
uses: Azure/k8s-create-secret@v1.1
with:
# Container registry URL
container-registry-url: https://${{env.REGISTRY_NAME}}.azurecr.io/${{env.CONTAINER_NAME}}
# Container registry username
container-registry-username: '${{ secrets.REGISTRY_USERNAME }}'
# Container registry password
container-registry-password: '${{ secrets.REGISTRY_PASSWORD }}'
# Type of Kubernetes secret. For example, docker-registry or generic
secret-type: docker-registry
# Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.
secret-name: acr-image-pull-secret

# Deploy to k8s cluster
- name: Deploy to Kubernetes cluster
uses: Azure/k8s-deploy@v4
with:
# deploy/promote/reject
action: deploy
# Path to the manifest files which will be used for deployment.
manifests: |
${{ env.DEPLOYMENT_MANIFEST_PATH }}
# Fully qualified resource URL of the image(s) to be used for substitutions on the manifest files Example: contosodemo.azurecr.io/helloworld:test
images: |
${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
# Name of a docker-registry secret that has already been set up within the cluster. Each of these secret names are added under imagePullSecrets field for the workloads found in the input manifest files
imagepullsecrets: |
acr-image-pull-secret


Loading