Skip to content

Commit

Permalink
SAASMLOPS-1139 Airlift sp specific files from master
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-vinnik-sp committed Mar 11, 2024
1 parent ee4c4f1 commit c3f3668
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
93 changes: 93 additions & 0 deletions build.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
@Library('sailpoint/jenkins-release-utils')_
pipeline {

parameters {
string(name: 'BRANCH', defaultValue: 'master')
}

agent {
kubernetes {
yaml "${libraryResource 'pods/build-container.yaml'}"
}
}

environment {

SERVICE_NAME = "feast-bytewax"
GITHUB_REPO = "git@github.com:sailpoint/feast.git"
ECR_REPOSITORY = "${env.AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com"
REPOSITORY_NAME = "sailpoint/${SERVICE_NAME}"
}

stages {
stage('Checkout SCM') {
steps {
checkout(
[$class: 'GitSCM',
branches: [[name: "origin/${BRANCH}"], [name: "*/master"]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'git-automation-ssh', url: "$GITHUB_REPO"]]])
}
}
stage('Build Docker') {
steps {
container('kaniko') {
script {
echo "publishing ${SERVICE_NAME}:${BUILD_NUMBER}"

sh """
/kaniko/executor \
--context ./ \
--dockerfile ./sailpoint-bytewax.dockerfile \
--build-arg DOCKER_BUILDKIT=1 \
--destination=${ECR_REPOSITORY}/${REPOSITORY_NAME}:${BUILD_NUMBER}
"""
}
}
}
}
}
post {
always {
junit allowEmptyResults: true, testResults: '**/cov/*.xml'
}
success {
container('aws-cli') {
echo "Rebasing tag 'latest' to be '${BUILD_NUMBER}'"
sh '''
MANIFEST=`aws ecr batch-get-image --repository-name ${REPOSITORY_NAME} --image-ids imageTag=${BUILD_NUMBER} --query images[].imageManifest --output text`
aws ecr put-image --repository-name ${REPOSITORY_NAME} --image-tag latest --image-manifest "\$MANIFEST"
'''
}
slackSend(
channel : "proj-eng-iai-cicd",
message : "${SERVICE_NAME}:${BUILD_NUMBER} Build \n ${JOB_URL} ",
replyBroadcast: true,
color : "#33ff33",
failOnError : false
)
}
failure {
container('aws-cli') {
assumePodRole {
script {
sh '''#!/bin/bash
aws ecr batch-delete-image \
--repository-name $REPOSITORY_NAME \
--image-ids imageTag=$BUILD_NUMBER
'''
}
}
}

slackSend(
channel : "proj-eng-iai-cicd",
message : "@iai-tarragon ${SERVICE_NAME}:${BUILD_NUMBER} Build broken \n ${JOB_URL} ",
replyBroadcast: true,
color : "#ff3333",
failOnError : false
)
}
}
}
28 changes: 28 additions & 0 deletions sailpoint-bytewax.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Original File: sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile
FROM 406205545357.dkr.ecr.us-east-1.amazonaws.com/sailpoint/python3.10:1 AS build

RUN dnf install --refresh -y git

WORKDIR /bytewax

# Copy dataflow code
COPY sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_dataflow.py /bytewax
COPY sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py /bytewax

# Copy entrypoint
COPY sdk/python/feast/infra/materialization/contrib/bytewax/entrypoint.sh /bytewax

# Copy necessary parts of the Feast codebase
COPY sdk/python sdk/python
COPY protos protos
COPY go go
COPY setup.py setup.py
COPY pyproject.toml pyproject.toml
COPY README.md README.md

# Install Feast for AWS with Bytewax dependencies
# We need this mount thingy because setuptools_scm needs access to the
# git dir to infer the version of feast we're installing.
# https://github.com/pypa/setuptools_scm#usage-from-docker
# I think it also assumes that this dockerfile is being built from the root of the directory.
RUN --mount=source=.git,target=.git,type=bind SETUPTOOLS_SCM_PRETEND_VERSION=1 pip3 install --no-cache-dir '.[aws,gcp,bytewax,snowflake,postgres]'

0 comments on commit c3f3668

Please sign in to comment.