Skip to content

Commit

Permalink
Change a few prefixes from ns to vega
Browse files Browse the repository at this point in the history
  • Loading branch information
iduartgomez committed May 3, 2020
1 parent 3878c58 commit 8782c17
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
global:
- export PATH="$PATH:$HOME/bin"
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/lib"
- export NS_LOCAL_IP=0.0.0.0
- export VEGA_LOCAL_IP=0.0.0.0
addons:
apt:
packages:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vega

Previously known as native_spark
Previously known as `native_spark`.

[![Join the chat at https://gitter.im/fast_spark/community](https://badges.gitter.im/fast_spark/community.svg)](https://gitter.im/fast_spark/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/rajasekarv/native_spark.svg?branch=master)](https://travis-ci.org/rajasekarv/native_spark)
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ RUN set -e; \
# Locales
locale-gen en_US.UTF-8; \
# Set SSH user
groupadd ns && useradd -ms /bin/bash -g ns ns_user; \
groupadd ns && useradd -ms /bin/bash -g ns vega_user; \
# Cleanup
#apt-get purge -y --auto-remove $tempPkgs; \
apt-get autoremove -q -y; \
apt-get clean -yq; \
rm -rf /var/lib/apt/lists/*
COPY --from=building /home/release .
COPY --chown=ns_user:ns ./docker/id_rsa.pub /home/ns_user/.ssh/authorized_keys
COPY --chown=vega_user:ns ./docker/id_rsa.pub /home/vega_user/.ssh/authorized_keys
COPY ./docker/id_rsa /root/.ssh/
RUN chmod 600 /root/.ssh/id_rsa /home/ns_user/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/id_rsa /home/vega_user/.ssh/authorized_keys
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
8 changes: 4 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ networks:
native-spark:

services:
ns_master:
vega_master:
image: vega:latest
ports:
- "3000"
Expand All @@ -16,11 +16,11 @@ services:
source: "../target"
target: "/home/dev"
environment:
NS_DEPLOYMENT_MODE: distributed
VEGA_DEPLOYMENT_MODE: distributed
depends_on:
- ns_worker
- vega_worker

ns_worker:
vega_worker:
image: vega:latest
ports:
- "10500"
Expand Down
2 changes: 1 addition & 1 deletion docker/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCcjmvyQT2FsdM795b3dGv3GGDGIsz7v6YsogfjQmEbGdpaXNtqyYIpp/VGyc5/ia1e2n85MAUO2mjWxrAHU6+4owl8q6enARG+/xC9a6vuWdsBNhWV6V/pYVJnPAi/v4t8+uPnAY+6KaMuUKSOYNsfu0r88tzIW5nXTS/yG24BryyMzDuLbWzLGpR6PCjxhsMKqn41WoomJ+GEfH2acz/0Le82fGxUSuukkQJoSXGA5aMFaOgTmhXlVKyN2b/+pbxThB9YAB7mTsevQrit+J+Xvz0SOD332CV79DIysWwx19kKjcVYsIt5wNrknCehxV+I4IZ3+1LT4arWe+j0STJ ns_user@a0e0c0941a35
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCcjmvyQT2FsdM795b3dGv3GGDGIsz7v6YsogfjQmEbGdpaXNtqyYIpp/VGyc5/ia1e2n85MAUO2mjWxrAHU6+4owl8q6enARG+/xC9a6vuWdsBNhWV6V/pYVJnPAi/v4t8+uPnAY+6KaMuUKSOYNsfu0r88tzIW5nXTS/yG24BryyMzDuLbWzLGpR6PCjxhsMKqn41WoomJ+GEfH2acz/0Le82fGxUSuukkQJoSXGA5aMFaOgTmhXlVKyN2b/+pbxThB9YAB7mTsevQrit+J+Xvz0SOD332CV79DIysWwx19kKjcVYsIt5wNrknCehxV+I4IZ3+1LT4arWe+j0STJ vega_user@a0e0c0941a35
20 changes: 10 additions & 10 deletions docker/testing_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ SCRIPT_PATH=`dirname $(readlink -f $0)`
cd $SCRIPT_PATH

# Deploy a testing cluster with one master and 2 workers
docker-compose up --scale ns_worker=2 -d
docker-compose up --scale vega_worker=2 -d

# Since we can't resolved domains yet, we have to get each container IP to create the config file
WORKER_IPS=$(docker-compose ps | grep -oE "docker_ns_worker_[0-9]+" \
WORKER_IPS=$(docker-compose ps | grep -oE "docker_vega_worker_[0-9]+" \
| xargs -I{} docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {})
read -a WORKER_IPS <<< $(echo $WORKER_IPS)
slaves=$(printf ",\"ns_user@%s\"" "${WORKER_IPS[@]}")
slaves=$(printf ",\"vega_user@%s\"" "${WORKER_IPS[@]}")
slaves="slaves = [${slaves:1}]"

MASTER_IP=$(docker-compose ps | grep -oE "docker_ns_master_[0-9]+" \
MASTER_IP=$(docker-compose ps | grep -oE "docker_vega_master_[0-9]+" \
| xargs -I{} docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {})

CONF_FILE=`cat <<EOF
Expand All @@ -22,26 +22,26 @@ EOF
`

count=0
for WORKER in $(docker-compose ps | grep -oE "docker_ns_worker_[0-9]+")
for WORKER in $(docker-compose ps | grep -oE "docker_vega_worker_[0-9]+")
do
echo "Setting $WORKER";
docker exec -e CONF_FILE="$CONF_FILE" -e NS_LOCAL_IP="${WORKER_IPS[count]}" -w /home/ns_user/ $WORKER \
docker exec -e CONF_FILE="$CONF_FILE" -e VEGA_LOCAL_IP="${WORKER_IPS[count]}" -w /home/vega_user/ $WORKER \
bash -c 'echo "$CONF_FILE" >> hosts.conf && \
echo "NS_LOCAL_IP=$NS_LOCAL_IP" >> .ssh/environment && \
echo "VEGA_LOCAL_IP=$VEGA_LOCAL_IP" >> .ssh/environment && \
echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config && \
echo "AcceptEnv RUST_BACKTRACE" >> /etc/ssh/sshd_config && \
service ssh start';
(( count++ ));
done

docker exec -e CONF_FILE="$CONF_FILE" -e NS_LOCAL_IP="${MASTER_IP}" -w /root/ docker_ns_master_1 \
docker exec -e CONF_FILE="$CONF_FILE" -e VEGA_LOCAL_IP="${MASTER_IP}" -w /root/ docker_vega_master_1 \
bash -c 'echo "$CONF_FILE" >> hosts.conf && \
echo "export NS_LOCAL_IP=$NS_LOCAL_IP" >> .bashrc &&
echo "export VEGA_LOCAL_IP=$VEGA_LOCAL_IP" >> .bashrc &&
echo "SendEnv RUST_BACKTRACE" >> ~/.ssh/config
';
for WORKER_IP in ${WORKER_IPS[@]}
do
docker exec docker_ns_master_1 bash -c "ssh-keyscan ${WORKER_IP} >> ~/.ssh/known_hosts"
docker exec docker_vega_master_1 bash -c "ssh-keyscan ${WORKER_IP} >> ~/.ssh/known_hosts"
done

# When done is posible to open a shell into the master and run any of the examples in distributed mode
4 changes: 2 additions & 2 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use tokio::runtime::{Handle, Runtime};
/// The key is: {shuffle_id}/{input_id}/{reduce_id}
type ShuffleCache = Arc<DashMap<(usize, usize, usize), Vec<u8>>>;

const ENV_VAR_PREFIX: &str = "NS_";
pub(crate) const THREAD_PREFIX: &str = "_NS";
const ENV_VAR_PREFIX: &str = "VEGA_";
pub(crate) const THREAD_PREFIX: &str = "_VEGA";
static CONF: OnceCell<Configuration> = OnceCell::new();
static ENV: OnceCell<Env> = OnceCell::new();
static ASYNC_RT: Lazy<Option<Runtime>> = Lazy::new(Env::build_async_executor);
Expand Down
2 changes: 1 addition & 1 deletion src/io/local_file_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl LocalFsReaderConfig {

/// Number of partitions to use per executor to perform the load tasks.
/// One executor must be used per host with as many partitions as CPUs available (ideally).
pub fn num_partitions_per_executor(mut self, num: u64) -> Self {
pub fn num_partitiovega_per_executor(mut self, num: u64) -> Self {
self.executor_partitions = Some(num);
self
}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ use std::fs::{create_dir_all, File};
use std::io::prelude::*;
use std::sync::Arc;

use once_cell::sync::Lazy;
use vega::io::*;
use vega::partitioner::HashPartitioner;
use vega::rdd::CoGroupedRdd;
use vega::*;
use once_cell::sync::Lazy;

static CONTEXT: Lazy<Arc<Context>> = Lazy::new(|| Context::new().unwrap());
//static AGGREGATOR: Lazy<Arc<Aggregator<data,dat1,dat2>>> = Lazy::new(|| Aggregator::new().unwrap());
static WORK_DIR: Lazy<std::path::PathBuf> = Lazy::new(std::env::temp_dir);
const TEST_DIR: &str = "ns_test_dir";
const TEST_DIR: &str = "vega_test_dir";

#[allow(unused_must_use)]
fn set_up(file_name: &str) {
Expand Down
10 changes: 5 additions & 5 deletions user_guide/src/chapter_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ In order to execute application code some preliminary setup is required. (So far
# create the same hosts.conf file in every machine:
$ cd ~ && vim hosts.conf ...
```
* The environment variable `NS_LOCAL_IP` must be set for the user executing application code.
* The environment variable `VEGA_LOCAL_IP` must be set for the user executing application code.
* In `local` it suffices to set up for the current user:
> $ export NS_LOCAL_IP=0.0.0.0
> $ export VEGA_LOCAL_IP=0.0.0.0
* In `distributed` the variable is required, aditionally, to be set up for the users remotely connecting. Depending on the O.S. and ssh defaults this may require some additional configuration. E.g.:
```doc
$ ssh [email protected]
$ sudo echo "NS_LOCAL_IP=172.0.0.10" >> .ssh/environment
$ sudo echo "VEGA_LOCAL_IP=172.0.0.10" >> .ssh/environment
$ sudo echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config
$ service ssh restart
```
Expand All @@ -52,7 +52,7 @@ examples just run them. In `local`:
> cargo run --example make_rdd
In `distributed`:
> export NS_DEPLOYMENT_MODE=distributed
> export VEGA_DEPLOYMENT_MODE=distributed
>
> cargo run --example make_rdd
Expand All @@ -69,7 +69,7 @@ and deploying distributed mode on your local host. In order to use them:
This will execute all the necessary steeps to to deploy a working network of containers where you can execute the tests. When finished you can attach a shell to the master and run the examples:
```doc
$ docker exec -it docker_ns_master_1 bash
$ docker exec -it docker_vega_master_1 bash
$ ./make_rdd
```

Expand Down

0 comments on commit 8782c17

Please sign in to comment.