Skip to content

Publishing Presto to the Artifactory

Jenny Thompson edited this page Sep 5, 2018 · 14 revisions

Choose which branch to build. We normally want the latest presto release, which is of the form 0.xxx. Look through https://github.com/stitchfix/presto/releases to find it. Check the release notes for this release at https://prestodb.io/docs/current/release.html

N.B.

For historic reasons, this is a fork of the Teradata presto. However, that version appears to have been abandoned, so we now use the main presto project directly.

Updating

# You should update the presto repo to get the latest upstream.
git clone [email protected]:stitchfix/presto.git
cd presto
git remote add upstream [email protected]:prestodb/presto.git
git fetch upstream
git rebase upstream/master
git push
# git push doesn't push tags by default,
# but they are needed for `git describe` to work, 
# which becomes the version in the ui.
git push origin --tags

# You should then be able to checkout the tagged release
git checkout 0.209
# and create a branch from that tag
git checkout -b 0.209-sf

On that branch you need to add and modify some config files. You can cherry-pick the commit aa9f4cd265

git cherry-pick aa9f4cd2653b138e6f0a6da098ecaa84da25ccda
git push --set-upstream origin 0.209-sf

or follow the manual steps below.

Manual config settings

Add the snippet

    <!-- Credentials go into settings.xml -->
    <distributionManagement>
        <snapshotRepository>
            <id>artifactory-snapshots</id>
            <url>http://artifactory.vertigo.stitchfix.com/artifactory/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>artifactory-releases</id>
            <url>http://artifactory.vertigo.stitchfix.com/artifactory/releases</url>
        </repository>
    </distributionManagement>

to pom.xml.

Then in the root directory add the files

prepcreds.bash

#!/bin/bash

# Prepare a credentials file so we can publish to artifactory.  
# For now making a call and updating the gradle properties with 
# the right value.  

CURRENT_RESULT=$(curl http://vault.vertigo.stitchfix.com/secure/flotilla-auto)
sed "s/dummy/$CURRENT_RESULT/" settings.xml > settings.xml2
mv settings.xml2 settings.xml 
echo "Credentials file saved"

and

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
          xmlns="http://maven.apache.org/SETTINGS/1.1.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!-- Settings for publishing to artifactory at stitchfix as of Sept 6, 2016.  Add these settings
         by running maven <goals> -settings settings.xml  (use double dash settings) -->
    <servers>
        <server>
            <username>flotilla</username>
            <password>dummy</password>
            <id>artifactory-releases</id>
        </server>
        <server>
            <username>flotilla</username>
            <password>dummy</password>
            <id>artifactory-snapshots</id>
        </server>
    </servers>
    <profiles>
        <profile>
            <repositories>
                <repository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>artifactory-releases</id>
                    <name>artifactory-releases</name>
                    <url>http://artifactory.vertigo.stitchfix.com/artifactory/releases</url>
                </repository>
                <repository>
                    <snapshots/>
                    <id>artifactory-snapshots</id>
                    <name>artifactory-snapshots</name>
                    <url>http://artifactory.vertigo.stitchfix.com/artifactory/snapshots</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>central</id>
                    <name>plugins-release</name>
                    <url>http://artifactory.vertigo.stitchfix.com/artifactory/plugins-release</url>
                </pluginRepository>
                <pluginRepository>
                    <snapshots/>
                    <id>snapshots</id>
                    <name>plugins-snapshot</name>
                    <url>http://artifactory.vertigo.stitchfix.com/artifactory/plugins-snapshot</url>
                </pluginRepository>
            </pluginRepositories>
            <id>artifactory</id>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>artifactory</activeProfile>
    </activeProfiles>
</settings>

Then commit these files and push the branch to the Stitch Fix Presto repository.

Building on Uhura

Go to https://uhura.daylight.stitchfix.com/workflows/presto-server-build (See Uhura-build-definition for the original build definition.)

Make sure that the script value SOURCE_BRANCH is pointing to the branch you have modified. Then run the job.

When the job is finished, you should see the new version at http://artifactory.vertigo.stitchfix.com/artifactory/webapp/#/artifacts/browse/tree/General/releases/com/facebook/presto

If you published a snapshot version instead, it will end up at http://artifactory.vertigo.stitchfix.com/artifactory/webapp/#/artifacts/browse/tree/General/snapshots/com/facebook/presto