예제 #1
0
        public JanusGraphServerFixture()
        {
            var config      = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var dockerImage = config["dockerImage"];

            _container = new ContainerBuilder <GremlinServerContainer>()
                         .ConfigureDockerImageName(dockerImage)
                         .ConfigureLogging(builder =>
            {
                builder.AddConsole();
                builder.SetMinimumLevel(LogLevel.Debug);
            })
                         .ConfigureContainer((context, container) =>
            {
                container.ExposedPorts.Add(GremlinServerContainer.GremlinServerPort);

                container.BindMounts.Add(new Bind
                {
                    HostPath      = $"{AppContext.BaseDirectory}/load_data.groovy",
                    ContainerPath = "/docker-entrypoint-initdb.d/load_data.groovy",
                    AccessMode    = AccessMode.ReadOnly
                });
            })
                         .Build();
            _container.ServerStartedCheckTraversal = "g.V().has('name', 'hercules').hasNext()";
        }
        public JanusGraphServerFixture()
        {
            var config      = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var dockerImage = config["dockerImage"];
            var port        = Convert.ToInt32(config["serverPort"]);

            _container = new GenericContainerBuilder <GremlinServerContainer>()
                         .Begin()
                         .WithImage(dockerImage)
                         .WithExposedPorts(port)
                         .Build();
        }
예제 #3
0
        public JanusGraphServerFixture()
        {
            var config      = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var dockerImage = config["dockerImage"];

            _container = new GenericContainerBuilder <GremlinServerContainer>()
                         .Begin()
                         .WithImage(dockerImage)
                         .WithExposedPorts(GremlinServerContainer.GremlinServerPort)
                         .WithMountPoints(($"{AppContext.BaseDirectory}/load_data.groovy",
                                           "/docker-entrypoint-initdb.d/load_data.groovy", "bind"))
                         .Build();
            _container.ServerStartedCheckTraversal = "g.V().has('name', 'hercules').hasNext()";
        }