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

Update the Entrypoint of Web Search #404

Merged
merged 6 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix basic bugs
  • Loading branch information
xusine committed Feb 14, 2023
commit 1847b4abe4adcc87ce6febe99054c49df02fc09a
3 changes: 2 additions & 1 deletion benchmarks/web-search/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ENV SCALE 50
ENV AGENT_ID 1
ENV NUM_AGENTS 1

RUN apt update && apt install python3
# The entrypoint is a Python script
RUN apt update && apt install python3 -y

RUN cd $BASE_PATH \
&& wget "archive.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz" \
Expand Down
10 changes: 6 additions & 4 deletions benchmarks/web-search/client/docker-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
TEMPLATES[dist] = f.read()

# Generate SearchDriver.java
with open(f"{FABAN_HOME}/search/src/sample/searchdrive/SearchDriver.java", "w") as f:
with open(f"{FABAN_HOME}/search/src/sample/searchdriver/SearchDriver.java", "x") as f:
f.write("// this file is automatically generated by docker-entrypoint.py. DO NOT MODIFY. \n")
f.write(HEADER)
# Base on the interval type, start writing stuff.
Expand Down Expand Up @@ -96,7 +96,7 @@
STEADY_TIME = arg.steady,
FABAN_OUTPUT_DIR = os.environ["FABAN_OUTPUT_DIR"],
AGENTS = "{}:{}".format(
socket.gethostbyname(),
socket.gethostname(),
os.environ["NUM_AGENTS"]
),
SERVER_IP = arg.server_ip,
Expand All @@ -108,9 +108,11 @@
))

# Setup the environment
os.environ["JAVA_HOME"] = os.path.dirname(os.path.dirname(os.readlink(shutil.which("javac"))))
os.environ["JAVA_HOME"] = os.path.dirname(os.path.dirname(os.path.realpath(shutil.which("javac"))))
os.environ["SOLR_JAVA_HOME"] = os.environ["JAVA_HOME"]

print(os.environ["JAVA_HOME"])

# Setup Faban
os.system(f"{FABAN_HOME}/master/bin/startup.sh")

Expand Down Expand Up @@ -148,7 +150,7 @@
time.sleep(3)

# Start Agent
os.system(f"java -classpath {CLASS_PATH} -Xmx{os.environ['CLIENT_HEAP_SIZE']} -Xms{os.environ['CLIENT_HEAP_SIZE']} -Djava.security.policy={os.environ['POLICY_PATH']} com.sun.faban.driver.engine.AgentImpl 'SearchDriver' {os.environ['AGENT_ID']} {socket.gethostbyname()} &")
os.system(f"java -classpath {CLASS_PATH} -Xmx{os.environ['CLIENT_HEAP_SIZE']} -Xms{os.environ['CLIENT_HEAP_SIZE']} -Djava.security.policy={os.environ['POLICY_PATH']} com.sun.faban.driver.engine.AgentImpl 'SearchDriver' {os.environ['AGENT_ID']} {socket.gethostname()} &")

# Start Master
os.system(f"java -classpath {CLASS_PATH} -Xmx{os.environ['CLIENT_HEAP_SIZE']} -Xms{os.environ['CLIENT_HEAP_SIZE']} -Djava.security.policy={os.environ['POLICY_PATH']} -Dbenchmark.config={os.environ['BENCHMARK_CONFIG']} com.sun.faban.driver.engine.MasterImpl")
Expand Down