Esempio n. 1
0
def pushArtifact(artifact, version, user=None, token=None, force=False):

    dpl = artifact.deploy
    file = "{filename}_v{version}.{ext}".format(
        filename=artifact.name,
        version=version,
        ext=artifact.file.split(".")[1])
    url = "{url}/{repo}/{path}/{file}".format(url=dpl.url,
                                              repo=dpl.repo,
                                              path=dpl.path,
                                              file=file)

    if (force == False and ArtifactoryPath("{url}".format(url=url)).exists()):
        print(
            "This artifact version has already been pushed. Please bump the version before pushing (skelebot bump) or force push (-f)."
        )
        sys.exit(1)

    if (user == None):
        user = input("Please provide a valid Artifactory user: "******"Please provide a valid Artifactory token: ")

    print("Deploying {file} to {url}".format(file=file, url=url))
    path = ArtifactoryPath(url, auth=(user, token))
    os.rename(artifact.file, file)
    try:
        path.deploy_file(file)
    except:
        os.rename(file, artifact.file)
        raise
    os.rename(file, artifact.file)
Esempio n. 2
0
def upload():
    path = ArtifactoryPath(
        "http://artifactory.calormen.net:8040/artifactory/generic-local/test",
        auth=('admin', 'f22-demo'))

    path.deploy_file("test.txt")

    path = ArtifactoryPath(
        "http://artifactory.calormen.net:8040/artifactory/generic-local/test/test_results",
        auth=('admin', 'f22-demo'))

    path.deploy_file("test-reports/results.xml")
    path.deploy_file("test-reports/results_download.xml")
Esempio n. 3
0
path = ArtifactoryPath(
    "https://artifacts.luxonis.com/artifactory/blobconverter-backup/blobs",
    auth=(args.username, args.password))
if not path.exists():
    path.mkdir()

priority_models = [
    "mobilenet-ssd", "efficientnet-b0",
    "vehicle-license-plate-detection-barrier-0106",
    "vehicle-detection-adas-0002", "license-plate-recognition-barrier-0007"
    "vehicle-attributes-recognition-barrier-0039",
    "face-detection-retail-0004", "landmarks-regression-retail-0009"
]
backup_shaves = range(1, 17)

for model_name, shaves in itertools.product(priority_models, backup_shaves):
    print("Deploying {} with {} shaves...".format(model_name, shaves))
    try:
        path.deploy_file(blobconverter.from_zoo(model_name, shaves=shaves))
    except Exception as ex:
        print("Deployment failed due to {}".format(str(ex)))

for model_name in blobconverter.zoo_list():
    if model_name in priority_models:
        continue
    print("Deploying {}...".format(model_name))
    try:
        path.deploy_file(blobconverter.from_zoo(model_name))
    except Exception as ex:
        print("Deployment failed due to {}".format(str(ex)))