<commit_before>[Unit]
After=install-%p.service
After=docker.service
After=weave.service
#After=cassandra.service
Description=<%= @description %>
Requires=install-%p.service
Requires=docker.service
Requires=weave.service
#Requires=cassandra.service

[Service]
User=core
TimeoutStartSec=0
KillMode=none

# Read the local environment (needed to to get COREOS_PRIVATE_IPV4)
EnvironmentFile=/etc/environment

# Ensure our etcd registry is present
ExecStartPre=-/usr/bin/etcdctl mkdir /<%= @service_discovery_key %>

# Remove old docker containers with the same name if they exist
ExecStartPre=-/usr/bin/docker kill %p-%i
ExecStartPre=-/usr/bin/docker rm %p-%i

# Start the docker container with weave networking (we pass in the etcd URL via the environment)
# NOTE: we need to use an IP address here as Akka will otherwise map the DNS name to the wrong NIC address!
ExecStartPre=/usr/bin/sh -c '/usr/bin/sudo /opt/bin/weave run <%= @ip_address %>/16 --name %p-%i -h %p-%i.weave.local \
  -e "DOMAIN=<%= @domain %>" \
  -e "SERVICE_KEY=<%= @service_discovery_key %>" \
  -e "ROLES=<%= @roles %>" \
  -e "APP_ADDR=<%= @ip_address %>" \
  -e CASSANDRA=$(/usr/bin/etcdctl ls /<%= @service_discovery[:cassandra] %> | /usr/bin/sed "s|^/<%= @service_discovery[:cassandra] %>/||") \
  -e "ETCD_URL=http://${COREOS_PRIVATE_IPV4}:4001" \
  <%= @image %>'
ExecStart=/usr/bin/docker attach %p-%i

# When stopped, stop the docker container
ExecStop=/usr/bin/docker stop %p-%i<commit_msg>Attempt at adding in an active wait loop for Cassandra service<commit_after>[Unit]
After=install-%p.service
After=docker.service
After=weave.service
#After=cassandra.service
Description=<%= @description %>
Requires=install-%p.service
Requires=docker.service
Requires=weave.service
#Requires=cassandra.service

[Service]
User=core
TimeoutStartSec=0
KillMode=none

# Read the local environment (needed to to get COREOS_PRIVATE_IPV4)
EnvironmentFile=/etc/environment

# Ensure our etcd registry is present
ExecStartPre=-/usr/bin/etcdctl mkdir /<%= @service_discovery_key %>

# Remove old docker containers with the same name if they exist
ExecStartPre=-/usr/bin/docker kill %p-%i
ExecStartPre=-/usr/bin/docker rm %p-%i

# Wait until Cassandra is up
ExecStartPre=/bin/sh -c 'COUNT=$(/usr/bin/etcdctl ls /<%= @service_discovery[:cassandra] %> | /usr/bin/wc -l); while [ COUNT -eq 0 ]; do sleep 1; COUNT=$(/usr/bin/etcdctl ls /<%= @service_discovery[:cassandra] %> | /usr/bin/wc -l); done'

# Start the docker container with weave networking (we pass in the etcd URL via the environment)
# NOTE: we need to use an IP address here as Akka will otherwise map the DNS name to the wrong NIC address!
ExecStartPre=/usr/bin/sh -c '/usr/bin/sudo /opt/bin/weave run <%= @ip_address %>/16 --name %p-%i -h %p-%i.weave.local \
  -e "DOMAIN=<%= @domain %>" \
  -e "SERVICE_KEY=<%= @service_discovery_key %>" \
  -e "ROLES=<%= @roles %>" \
  -e "APP_ADDR=<%= @ip_address %>" \
  -e CASSANDRA=$(/usr/bin/etcdctl ls /<%= @service_discovery[:cassandra] %> | /usr/bin/sed "s|^/<%= @service_discovery[:cassandra] %>/||") \
  -e "ETCD_URL=http://${COREOS_PRIVATE_IPV4}:4001" \
  <%= @image %>'
ExecStart=/usr/bin/docker attach %p-%i

# When stopped, stop the docker container
ExecStop=/usr/bin/docker stop %p-%i
{'fraction_non_alphanumeric': 0.1597542242703533, 'fraction_numerical': 0.006144393241167435, 'mean_word_length': 4.613793103448276, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7529300', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1148, 'n_words': 302}