Giter Club home page Giter Club logo

testcontainers-minidfs-rs's Introduction

Opinionated Single Node HDFS Cluster Testcontainer

github action Crates.io Crates.io

Opinionated single node HDFS (DFS) cluster captured in a testcontainer.

testcontainers-minidfs-rs = "0.2"
testcontainers = "0.16"

Example:

use testcontainers::runners::AsyncRunner;
use testcontainers_minidfs_rs::*;

#[tokio::main]
async fn main() {

    let container = MiniDFS::runnable();
    let server_node = container.start().await;

    let hdfs_namenode_url = format!("hdfs://{}:{}/", "localhost", server_node.get_host_port_ipv4(PORT_NAME_NODE).await);
}

HDFS name node should be available at hdfs://localhost:9000 and name node http at http://localhost:8020.

Kerberos Support

MiniHDFS can be configured with kerberos support:

use testcontainers::runners::AsyncRunner;
use testcontainers_minidfs_rs::*;

#[tokio::main]
async fn main() {
    let container = MiniDFS::builder().with_kerberos(true).build();
    let server_node = container.start().await;
}

MiniDFS will be configured to support kerberos and all required files will be exposed as a docker volume mounted in the target directory.

use testcontainers::runners::AsyncRunner;
use testcontainers_minidfs_rs::*;

let container = MiniDFS::builder().with_kerberos(true).build();
// pre-populated kerberos cache file (ccache)
let kerberos_cache = container.image().kerberos_cache();
// kerberos configuration file krb5.conf
let kerberos_config = container.image().kerberos_config();
// hadoop configuration core-site.xml
let hdfs_config = container.image().hdfs_config();

All required files needed for hdfs client setup are exposed. (kinit will be executed by the container, kerberos cache will be produced).

Limitations

  • Ports are hardcoded, thus only single instance per host is possible
  • Not many configuration option can be tunned

testcontainers-minidfs-rs's People

Contributors

milenkovicm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.