Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Custom Container Registry using Fluent Java SDK #50

Open
ChristianSauer opened this issue Jun 29, 2018 · 5 comments
Open

Custom Container Registry using Fluent Java SDK #50

ChristianSauer opened this issue Jun 29, 2018 · 5 comments
Labels

Comments

@ChristianSauer
Copy link

Hello,
I need to use a custom container image from a Registry with UserName / Password. Can I use that Image somehow? I did see .WithContainerImage(""), but that has no applicable overload.

Furthermore, I am running a fully self contained image, with does not need anything (except a GPU and the necessary nvida libs), is there a way to run that?

Thanks!

@llidev
Copy link
Contributor

llidev commented Jun 29, 2018

Hi, you should be able to use any registry as Batch AI provide API to take registry url, image name and login credentials. In java you should be able to call .withImageSourceRegistry(ImageSourceRegistry imageSourceRegistry)

You can find examples to use nvidia-dgx-container-registry and azure-container-registry for your reference.

@ChristianSauer
Copy link
Author

@lliimsft THanks! I am using C# and for the life of me, I cannot find where I would have to call this method.

@llidev
Copy link
Contributor

llidev commented Jun 30, 2018

@ChristianSauer Please find ContainerSetting in .Net https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.batchai.models.containersettings?view=azure-dotnet

I don't have a fluent example on my hand, but for non-fluent C# library, you can do the following to specify private registry info:

var jobCreateParams = new JobCreateParameters()
{
    ....
    Cluster = new ResourceId(cluster.Id),
    NodeCount = 1,
    ContainerSettings = new ContainerSettings()
    {
        ImageSourceRegistry = new ImageSourceRegistry()
        {
            Image = "",
            ServerUrl = "",
            Credentials = new PrivateRegistryCredentials()
            {
                Username = "",
                Password = ""
            }
        }
    },
    ...
};

client.Jobs.Create(rgName, workspaceName, expName, jobName, jobCreateParams);

Regarding to your second question on self contained image, I am sorry that currently Batch AI doesn't support to run bare container command and user has to specify a toolkit, python script and command line args for jobs.

@AlexanderYukhanov
Copy link
Contributor

@lliimsft, I believe the question is about Azure/azure-libraries-for-net ("fluent" sdk). from a quick glance it seems "fluent" doesn't expose functionality for specifying repository settings (cannot verify without c#). java fluent provides this functionality.

@ChristianSauer
Copy link
Author

@AlexanderYukhanov You are correct, the Fluent SDK does not support this.

@llidev llidev changed the title Custom Container Registry? Custom Container Registry using Fluent Java SDK Aug 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants