Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.0.1 #1

Merged
merged 25 commits into from
Jul 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9582600
token based authentication caching
genandre Apr 24, 2014
f19b428
Merge branch 'auth-token-cache' of https://github.com/giteshnandre/co…
May 13, 2014
5809dcf
Merge branch 'giteshnandre-auth-token-cache' into 0.4.0.0
May 13, 2014
9bf4c41
abort http connection before connection manager shut down
May 13, 2014
046ab68
Revert "fix a typo"
May 13, 2014
62d315a
Merge branch '0.4.0.0' of https://github.com/intel-cloud/cosbench int…
May 13, 2014
b679851
Revert "share one method in one client"
May 13, 2014
bbeb0a1
fix a typo
May 16, 2014
44917fd
update document to version 2.8.3
May 16, 2014
85f9752
update TODO list
May 16, 2014
6589d4f
update to v0.4.0 final
May 23, 2014
1bcdf21
get report for cancelled/terminated stage
Cxquan Jun 5, 2014
0f9aeb1
Merge pull request #184 from intel-cloud/0.4.0.0
Jun 12, 2014
c9700d0
Merge pull request #183 from Cxquan/0.4.0.0
Jun 12, 2014
23f3d6b
Merge pull request #185 from intel-cloud/0.4.0.0
Jun 12, 2014
05743ce
Update README.md
Jun 12, 2014
060e04e
Add related projects.
Jun 12, 2014
069a986
mark mandatory fields in adv config ui
Jun 25, 2014
2f48701
add policy parameter for swift storage policy
Jul 3, 2014
7d65a23
add policy parameter for swift storage policy
Jul 3, 2014
5de1b2f
get report for cancelled/terminated stage
Cxquan Jun 5, 2014
c2eb1f3
mark mandatory fields in adv config ui
Jun 25, 2014
6cbc932
Merge branch '0.4.0.1' of https://github.com/intel-cloud/cosbench int…
Jul 3, 2014
9f3eb00
add information about how to use storage policy
Jul 3, 2014
9bb2442
update the sample of storage policies section
Jul 4, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COSBench 0.4.0.b2 (14-ww17.1)
COSBench 0.4.0.0 (14-ww21.5)
------------------------------------
. #57: time synchronization
. #96: Creating Web UI facility for generating different workload configuration files
Expand All @@ -8,10 +8,6 @@
. #167: storage policy supporting for openstack swift
. #37: support CDMI interface
. #139: NullPointerException when a mission is aborted


COSBench 0.4.0.b1 (14-ww11.4)
------------------------------------
. #166: show driver alive state on controller index page
. #158: Extend "histogram" selector to support "open ranges"
. #165: enable Open range for object size in uniform and histogram
Expand All @@ -21,10 +17,6 @@
. #143: at loading archived workloads, even there are 100 workloads, the UI shows only 98.
. #140: duplicated workload id generated
. #151: avoid being challenged for each request


COSBench 0.4.0.a1 (14-ww1.4)
------------------------------------
. #137: when there are large # of archive jobs, exception will raise from archive list on web portal.
. #139: NullPointerException when a mission is aborted
. support http BASIC and DIGEST authentication
Expand Down
Binary file modified COSBench-User-Guide.odt
Binary file not shown.
Binary file modified COSBenchUserGuide.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ Mailing list: (http://cosbench.1094679.n5.nabble.com/)
*Other names and brands may be claimed as the property of others.


Other related projects
----------------------
COSBench-Workload-Generator: (https://github.com/giteshnandre/COSBench-Workload-Generator)

COSBench-Plot: (https://github.com/icclab/cosbench-plot)


= END =
8 changes: 4 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ TODO
----
COSBench is an ongoing project, in next six months, we plan to make below improvements:

1. more storage interface support, e.g. s3 and cdmi
1. more storage interface support, list is TBD.

2. async http request
2. authentication caching

3. usability enhancement, e.g. xml validator, error handling.
3. LIST operation

4. document improvement
4. workload packages shipped


If you have any other suggestions or you want to work with us together. please contact us at yaguang.wang@intel.com.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AmpliClient {

private HttpClient client = null;
/* current operation */
private volatile HttpUriRequest method;
private volatile HttpUriRequest request;
private int port;
private String host;
private String nsRoot;
Expand All @@ -54,20 +54,20 @@ public AmpliClient(HttpClient client, String host, int port, String nsRoot) {
}

public void dispose() {
method = null;
request = null;
HttpClientUtil.disposeHttpClient(client);
}

public void abort() {
if (method != null)
method.abort();
method = null;
if (request != null)
request.abort();
request = null;
}

public boolean login() throws IOException, HttpException {
String storageUrl = "http://" + this.host + ":" + this.port;

method = HttpClientUtil.makeHttpHead(storageUrl);
HttpHead method = HttpClientUtil.makeHttpHead(storageUrl);
HttpResponse response = null;
try {
response = client.execute(method);
Expand All @@ -89,14 +89,15 @@ public String StoreObject(String sourceFilename, String ampliNamespace,
AmpliException {
File file = new File(sourceFilename);

HttpPut method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
+ nsRoot;
method = HttpClientUtil.makeHttpPut(storageUrl + "/" + HttpClientUtil.encodeURL(ampliNamespace)
+ "/" + HttpClientUtil.encodeURL(ampliFilename));

((HttpPut)method).setEntity(new FileEntity(file, "application/octet-stream"));
method.setEntity(new FileEntity(file, "application/octet-stream"));

response = client.execute(method);

Expand Down Expand Up @@ -126,6 +127,7 @@ public String StoreObject(String sourceFilename, String ampliNamespace,
public String StoreStreamedObject(InputStream stream, long length,
String ampliNamespace, String ampliFilename) throws IOException,
HttpException, AmpliException {
HttpPut method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand All @@ -141,7 +143,7 @@ public String StoreStreamedObject(InputStream stream, long length,
entity.setChunked(false);
}

((HttpPut)method).setEntity(entity);
method.setEntity(entity);

response = client.execute(method);

Expand Down Expand Up @@ -189,6 +191,7 @@ public String StoreObject(byte[] data, String ampliNamespace,
String ampliFilename) throws IOException, HttpException,
AmpliException {
// int len = data.length;
HttpPut method = null;
String storageUrl = "http://" + this.host + ":" + this.port + nsRoot;
method = HttpClientUtil.makeHttpPut(storageUrl + "/" + HttpClientUtil.encodeURL(ampliNamespace) + "/"
+ HttpClientUtil.encodeURL(ampliFilename));
Expand All @@ -197,7 +200,7 @@ public String StoreObject(byte[] data, String ampliNamespace,

HttpResponse response = null;
try {
((HttpPut)method).setEntity(new ByteArrayEntity(data));
method.setEntity(new ByteArrayEntity(data));
response = client.execute(method);
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED) {
return response.getFirstHeader("ETag").getValue();
Expand All @@ -219,7 +222,7 @@ public byte[] getObject(String namespace, String objName)
throws IOException, HttpException, AmpliException {
String storageUrl = "http://" + this.host + ":" + this.port + nsRoot;

method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
HttpGet method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
+ "/" + HttpClientUtil.encodeURL(objName));

HttpResponse response = null;
Expand All @@ -246,7 +249,7 @@ public InputStream getObjectAsStream(String namespace, String objName)
throws IOException, HttpException, AmpliException {
String storageUrl = "http://" + this.host + ":" + this.port + nsRoot;

method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
HttpGet method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
+ "/" + HttpClientUtil.encodeURL(objName));

HttpResponse response = null;
Expand All @@ -269,6 +272,7 @@ public InputStream getObjectAsStream(String namespace, String objName)
public boolean deleteObject(String ampliNamespace, String name)
throws HttpException, IOException, AmpliException {

HttpDelete method = null;
HttpResponse response = null;

try {
Expand Down Expand Up @@ -298,6 +302,7 @@ public boolean deleteObject(String ampliNamespace, String name)
public AmpliPolicy createPolicy(AmpliPolicy policy) throws HttpException,
IOException, AmpliException {

HttpPut method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand Down Expand Up @@ -331,6 +336,7 @@ public AmpliPolicy createPolicy(AmpliPolicy policy) throws HttpException,
public AmpliPolicy getPolicy(String policyId) throws HttpException,
IOException, AmpliException {

HttpGet method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand Down Expand Up @@ -360,13 +366,13 @@ public AmpliPolicy getPolicy(String policyId) throws HttpException,

public AmpliNamespace createNamespace(AmpliNamespace namespace)
throws HttpException, IOException, AmpliException {

HttpResponse response = null;
HttpPut method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
+ nsRoot;

method = HttpClientUtil.makeHttpGet(storageUrl);
method = new HttpPut(storageUrl);

method.setHeader("Content-Type", "text/plain");

Expand Down Expand Up @@ -399,7 +405,7 @@ public String createNamespace(String namespace, String policy_id)
String storageUrl = "http://" + this.host + ":" + this.port
+ nsRoot;

method = HttpClientUtil.makeHttpPut(storageUrl);
method = new HttpPut(storageUrl);

method.setHeader("Content-Type", "text/plain");

Expand Down Expand Up @@ -432,6 +438,7 @@ public String createNamespace(String namespace, String policy_id)
public AmpliNamespace getNamespace(String name) throws HttpException,
IOException, AmpliException {

HttpGet method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand Down Expand Up @@ -462,6 +469,7 @@ public AmpliNamespace getNamespace(String name) throws HttpException,
public boolean isNamespaceExisted(String name) throws HttpException,
IOException, AmpliException {

HttpHead method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand Down Expand Up @@ -489,7 +497,7 @@ public boolean isNamespaceExisted(String name) throws HttpException,

public boolean deleteNamespace(String namespace) throws HttpException,
IOException, AmpliException {

HttpDelete method = null;
HttpResponse response = null;
try {
String storageUrl = "http://" + this.host + ":" + this.port
Expand Down Expand Up @@ -517,7 +525,7 @@ public Map<String, String> getObjectMetadata(String namespace,
String objName) throws IOException, HttpException, AmpliException {
String storageUrl = "http://" + this.host + ":" + this.port + nsRoot;

method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
HttpGet method = HttpClientUtil.makeHttpGet(storageUrl + "/" + HttpClientUtil.encodeURL(namespace)
+ "/" + HttpClientUtil.encodeURL(objName) + "?meta=http");

HttpResponse response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
<h3>Workload Matrix Configuration</h3>
<h5>You can configure workload matrix from here. You can generate or submit workloads directly. With 'Generate Workload File/s' option,
files will be generated and placed at 'workloads' directory inside COSBench installation directory. No workload files will be generated when
'Submit Workload/s' option is chosen and workloads will be submitted directly.</h5>
'Submit Workload/s' option is chosen and workloads will be submitted directly.
<br>(Note: * marked fields are mandatory.)</br>
</h5>
<div>
<form action="advanced-config-workload.do" method="post" class="content" >
<#if error?? >
<p><span class="error"><strong>Note</strong>: ${error}!</span></p>
</#if>
<label for="workload.matrix.name" >Workload Matrix Name:</label>
<label for="workload.matrix.name" ><strong>*</strong>Workload Matrix Name:</label>
<input id="workload.matrix.name" name="workload.matrix.name" size="15" maxlength="30"/>
<div id="workload-common-configuration" class="a1">
<div id="workload.as" class="a2">
Expand Down Expand Up @@ -103,7 +105,7 @@


<input id="workload-checkbox" type="checkbox" name="workload.matrix.checked" checked="checked" onClick="toggleDiv(this.nextElementSibling.nextElementSibling.nextElementSibling);" style="float:left">
<label for="workload-checkbox" class="a2">Workload Name:</label>
<label for="workload-checkbox" class="a2">*Workload Name:</label>
<input name="workload.name" size="15" maxlength="30"/>
<div name="workload.matrix" id="workload.matrix" class="a2" >
<input type="hidden" id="workload-number" name="workload-number" value="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,18 @@ public void cancel() {
private void cancelWorkload() {
String id = workloadContext.getId();
LOGGER.info("begin to cancel workload {}", id);
executor.shutdownNow();
executor.shutdown();
if (Thread.interrupted())
LOGGER.warn("get cancelled when canceling workload");
LOGGER.warn("get cancelled when canceling workload {}", id);
try {
executor.awaitTermination(5, TimeUnit.SECONDS);
if (!executor.awaitTermination(5, TimeUnit.SECONDS)
&& !executor.awaitTermination(5, TimeUnit.SECONDS))
executor.shutdownNow();
if (!awaitTermination(5) && !awaitTermination(10) && !awaitTermination(30))
LOGGER.warn("get cancelled when canceling workload {}", id);
} catch (InterruptedException e) {
LOGGER.warn("get cancelled when canceling workload");
executor.shutdownNow();
Thread.currentThread().interrupt();
}
if (!executor.isTerminated())
LOGGER.warn("fail to cancel current stage for workload {}", id);
Expand All @@ -309,5 +314,17 @@ private void cancelWorkload() {
workloadContext.setState(CANCELLED);
LOGGER.info("successfully cancelled workload {}", id);
}

private boolean awaitTermination(int seconds) {
try {
if (!executor.isTerminated()) {
LOGGER.info("wait {} seconds for workload to cancel ...", seconds);
executor.awaitTermination(seconds, TimeUnit.SECONDS);
}
} catch (InterruptedException e) {
LOGGER.debug("get cancelled when canceling workload");
}
return executor.isTerminated();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import static com.intel.cosbench.model.TaskState.*;

import com.intel.cosbench.bench.Metrics;
import com.intel.cosbench.bench.Report;
import com.intel.cosbench.controller.model.TaskContext;
import com.intel.cosbench.protocol.AbortResponse;

Expand Down Expand Up @@ -61,6 +63,10 @@ private void executeAbort() {

@Override
protected void handleResponse(AbortResponse response) {
Report report = new Report();
for (Metrics metrics : response.getReport())
report.addMetrics(metrics);
context.setReport(report);
context.setLog(response.getDriverLog());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

package com.intel.cosbench.protocol;

import java.util.List;

import com.intel.cosbench.bench.Metrics;


/**
* The response to get log from driver when aborted.
Expand All @@ -27,6 +31,7 @@
public class AbortResponse extends Response {

private String driverLog; /* driver log */
private List<Metrics> report; /* metrics report */

public AbortResponse() {
/* empty */
Expand All @@ -39,5 +44,13 @@ public String getDriverLog() {
public void setDriverLog(String driverLog) {
this.driverLog = driverLog;
}

public List<Metrics> getReport() {
return report;
}

public void setReport(List<Metrics> report) {
this.report = report;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
package com.intel.cosbench.driver.handler;

import java.io.IOException;
import java.util.Arrays;

import com.intel.cosbench.bench.Report;
import com.intel.cosbench.model.MissionInfo;
import com.intel.cosbench.protocol.*;

Expand All @@ -33,6 +35,8 @@ protected Response process(MissionInfo info) {

private Response getResponse(MissionInfo info) {
AbortResponse response = new AbortResponse();
Report report = info.getReport();
response.setReport(Arrays.asList(report.getAllMetrics()));
String log = null;
try {
log = info.getLogManager().getLogAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void run() {
secs -= 5;
}
if (!cancel) {
// workerContext.getStorageApi().abort();
workerContext.getStorageApi().abort();
workerContext.disposeRuntime();

LOGGER.debug("work agent {} has been alerted for timeout", idx);
Expand Down
Loading