Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 62737ca

Browse files
iwankgbskonefal
authored andcommitted
Getting rid of "centos_swan_image" (#658)
1 parent 6faf3f9 commit 62737ca

File tree

7 files changed

+19
-39
lines changed

7 files changed

+19
-39
lines changed

integration_tests/experiments/memcached-sensitivity-profile/experiment_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ func TestExperiment(t *testing.T) {
138138
"SWAN_MUTILATE_AGENT_CONNECTIONS": "1",
139139
"SWAN_MUTILATE_AGENT_AFFINITY": "false",
140140
"SWAN_MUTILATE_MASTER_AFFINITY": "false",
141-
"SWAN_KUBERNETES_CONTAINER_IMAGE": "centos_swan_image",
142141
}
143142

144143
Convey("With environment prepared for experiment", t, func() {

integration_tests/pkg/executor/kubernetes_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func TestKubernetesExecutor(t *testing.T) {
4343
// Pod executuor config.
4444
executorConfig := executor.DefaultKubernetesConfig()
4545
executorConfig.Address = fmt.Sprintf("http://127.0.0.1:%d", config.KubeAPIPort)
46-
executorConfig.ContainerImage = "centos_swan_image"
4746

4847
// Create kubectl helper for communicate with Kubernetes cluster.
4948
kubectl, err := testhelpers.NewKubeClient(executorConfig)

integration_tests/pkg/snap/sessions/docker_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func TestSnapDockerSession(t *testing.T) {
6262

6363
// Waiting for Kubernetes Executor.
6464
kubernetesConfig := executor.DefaultKubernetesConfig()
65-
kubernetesConfig.ContainerImage = "centos_swan_image"
6665
kubernetesConfig.Address = fmt.Sprintf("127.0.0.1:%d", config.KubeAPIPort)
6766
kubeExecutor, err := executor.NewKubernetes(kubernetesConfig)
6867
So(err, ShouldBeNil)

pkg/executor/kubernetes_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func TestKubernetes(t *testing.T) {
3434

3535
Convey("After create new pod object", t, func() {
3636
config := DefaultKubernetesConfig()
37-
config.ContainerImage = "centos_swan_image"
3837

3938
Convey("with default unspecified resources, expect BestEffort", func() {
4039
podExecutor := &k8s{config, nil}

vagrant/README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,7 @@ You will need to build [mutilate](https://github.com/leverich/mutilate) by hand
4444
sudo ln -svf /opt/swan/bin/* /usr/bin/
4545
```
4646

47-
Now you should be able to run an experiment on the Kubernetes cluster that was automatically provisioned. If you want to be able to run without Kuberenetes, then you will need to take a few more steps.
48-
49-
Some of the project dependencies are distributed as [Docker image](https://hub.docker.com/r/intelsdi/swan/). They need to be extracted from the container in order to be used for non-Kubernetes experiments. To do this you need to execute the following commands:
50-
51-
```sh
52-
make extract_binaries
53-
sudo chown -R $USER:$USER opt
54-
sudo cp -fa opt/swan /opt
55-
sudo ln -svf /opt/swan/bin/* /usr/bin/
56-
```
47+
Now you should be able to run an experiment on the Kubernetes cluster or your virtual machine.
5748

5849
If you want to be able to use [iBench](https://github.com/stanford-mast/iBench) they you will need to compile binaries and make then available in `$PATH` (see mutilate description above). Keep in mind that compiling iBench binaries may require a lot of RAM and can't be done on default Vagrant VM configuration.
5950

@@ -65,11 +56,11 @@ Vagrant will allocate 2 CPUs and 4096 MB RAM for the VM by default. You can cons
6556

6657
## Deeper dive
6758

68-
If you want to learn more about VM configuration and installed packages refer to [provisioning script](provision.sh).
59+
If you want to learn more about VM configuration and installed packages refer to [provisioning script](provision.sh). It calls three other scripts and their names should be self explanatory.
6960

7061
Note that the `~/.glide` directory from your host will be mounted on the VM to speed up Go dependency management.
7162

72-
The script is responsible for:
63+
The scripts are responsible for:
7364
* Installing all the necessary CentOS packages that are needed to build Swan, run experiments and analyse their results.
7465
* Installing [Snap](http://snap-telemetry.io/) and its plugins that are responsible for gathering experiment results.
7566
* Installing [Docker](https://www.docker.com/) that allows running experiment on [Kubernetes](https://kubernetes.io) cluster.
@@ -78,6 +69,12 @@ The script is responsible for:
7869
* Setting up SSH for root.
7970
* Installing [Go](https://golang.org/).
8071

72+
If you wish to setup experiment environment on another host then you should be able to run [provision_experiment_environment.sh](provision_experiment_environment.sh) on the host. You will need to provide following environmental variables when calling the script:
73+
* `SWAN_USER` - name of the user that will run experiments.
74+
* `HOME_DIR` - home directory of `SWAN_USER`
75+
76+
Example call can be found in [the provisioning script](provision.sh).
77+
8178
### Provisioners
8279

8380
There are two provisioners defined in the [Vagrantfile](Vagrantfile): `aws` and `virtualbox`. Our CI infracture uses the first of them while the second should be used for development. If you try to use `aws` provider on your own it will fail as AMI is not publicly available.

vagrant/provision_ci_environment.sh

+4-21
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,15 @@ if [ -e "$HOME_DIR/swan_s3_creds/.s3cfg" ]; then
4646
chown -R ${VAGRANT_USER}:${VAGRANT_USER} ${HOME_DIR}/.glide
4747
fi
4848

49-
echo "Synchronize /opt/swan"
50-
# For manuall installtion
51-
# sudo sh -c "mkdir -p /opt/swan && chown -R $USER:$USER /opt/swan"
52-
s3cmd sync s3://swan-artifacts/workloads/swan/ /opt/swan/
5349

54-
echo "Install binaries from /opt/swan"
55-
ln -sv ${SWAN_BIN}/* /bin/
56-
57-
echo "Download centos_swan_image docker image"
58-
s3cmd sync s3://swan-artifacts/workloads/centos_swan_image.tgz /tmp/centos_swan_image.tgz
59-
60-
61-
echo "Import centos_swan_image to docker"
62-
gunzip /tmp/centos_swan_image.tgz
63-
docker image load -i /tmp/centos_swan_image.tar
64-
docker images centos_swan_image
65-
66-
echo "Check centos_swan_image docker"
67-
docker run --rm centos_swan_image memcached -V
68-
docker run --rm centos_swan_image mutilate --version
69-
docker run --rm centos_swan_image caffe.sh --version
50+
echo "Downloading private dependencies"
51+
s3cmd cp --recursive s3://swan-artifacts/workloads/swan-private/ s3://swan-artifacts/workloads/swan/
7052
fi
7153
echo "--------------------------- Provisioning CI environment done (`date`)"
7254

7355
echo "--------------------------- Post install (`date`)"
74-
ln -sf $HOME_DIR/go/src/github.com/intelsdi-x/swan $HOME_DIR
56+
ln -svf $HOME_DIR/go/src/github.com/intelsdi-x/swan $HOME_DIR
57+
ln -svf /opt/swan/bin/* /bin/
7558
chown -R $SWAN_USER:$SWAN_USER $HOME_DIR
7659
chown -R $SWAN_USER:$SWAN_USER /opt/swan
7760

vagrant/provision_experiment_environment.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ wget --no-verbose https://github.com/intelsdi-x/swan/releases/download/${SWAN_VE
9999
tar -xzf /tmp/swan.tar.gz -C ${SWAN_BIN}
100100

101101

102-
echo "----------------------------- Install Swan Workloads(`date`)"
103-
sudo docker run -v /opt:/output intelsdi/swan cp -R /opt/swan /output
102+
echo "----------------------------- Pulling docker image (`date`)"
103+
docker pull intelsdi/swan
104+
105+
106+
echo "----------------------------- Retrieve binares from Docker container (`date`)"
107+
docker run --rm -v /opt:/output intelsdi/swan cp -R /opt/swan /output
104108

105109

106110
echo "----------------------------- Install Kubernetes (`date`)"

0 commit comments

Comments
 (0)