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

SAASMLOPS-1139 Airlift sp specific files from master #14

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
)
}
}
}
30 changes: 30 additions & 0 deletions sailpoint-bytewax.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 setuptools==69.* pip==24.* --upgrade --no-cache-dir \
'.[aws,gcp,bytewax,snowflake,postgres,grpcio]'
Loading