Skip to content

Commit

Permalink
refactor(scheduler): switch to fleet http api
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Monroy committed Sep 16, 2014
1 parent a97cdc3 commit f4c992d
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 242 deletions.
10 changes: 10 additions & 0 deletions contrib/coreos/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ coreos:
command: start
- name: fleet.service
command: start
- name: fleet.socket
command: start
content: |
[Socket]
# Talk to the API over a Unix domain socket (default)
ListenStream=/var/run/fleet.sock
Service=fleet.service

[Install]
WantedBy=sockets.target
- name: stop-update-engine.service
command: start
content: |
Expand Down
7 changes: 4 additions & 3 deletions controller/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def _command_announceable(self):

@transition(field=state, source=INITIALIZED, target=CREATED)
def create(self):
image = self.release.image
image = self.release.image + ':v' + str(self.release.version)
kwargs = {'memory': self.release.config.memory,
'cpu': self.release.config.cpu,
'tags': self.release.config.tags}
Expand All @@ -427,7 +427,7 @@ def deploy(self, new_release):
self.release = new_release
# deploy new container
new_job_id = self._job_id
image = self.release.image
image = self.release.image + ':v' + str(self.release.version)
c_type = self.type
kwargs = {'memory': self.release.config.memory,
'cpu': self.release.config.cpu,
Expand All @@ -453,7 +453,8 @@ def destroy(self):

def run(self, command):
"""Run a one-off command"""
rc, output = self._scheduler.run(self._job_id, self.release.image, command)
image = self.release.image + ':v' + str(self.release.version)
rc, output = self._scheduler.run(self._job_id, image, command)
return rc, output


Expand Down
1 change: 1 addition & 0 deletions controller/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ django-yamlfield==0.5
djangorestframework==2.3.14
docker-py==0.4.0
gunicorn==18.0
paramiko==1.14.1
psycopg2==2.5.2
python-etcd==0.3.0
PyYAML==3.11
Expand Down
Loading

0 comments on commit f4c992d

Please sign in to comment.