Skip to content

Commit

Permalink
Merge pull request #137 from Terradue/byteerror
Browse files Browse the repository at this point in the history
fix wrong bytes in log
  • Loading branch information
Emmanuel Mathot committed Nov 10, 2022
2 parents 3d61543 + 9d92381 commit 9f37598
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- cwltool upgraded to current version 3.1 + all requirements
- Fixed faulty bytes in log stream (PR #137)

## [v0.10.0] - 2021-03-31

Expand Down
4 changes: 3 additions & 1 deletion calrissian/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def follow_logs(self):
# kubernetes-client decodes them as utf-8 when _preload_content is True
# https://github.com/kubernetes-client/python/blob/fcda6fe96beb21cd05522c17f7f08c5a7c0e3dc3/kubernetes/client/rest.py#L215-L216
# So we do the same here
line = line.decode('utf-8').rstrip()
line = line.decode('utf-8', errors="ignore").rstrip()
log.debug('[{}] {}'.format(pod_name, line))
log.info('[{}] follow_logs end'.format(pod_name))

Expand All @@ -147,6 +147,7 @@ def wait_for_completion(self):
for event in w.stream(self.core_api_instance.list_namespaced_pod, self.namespace, field_selector=self._get_pod_field_selector()):
pod = event['object']
status = self.get_first_or_none(pod.status.container_statuses)
log.info('pod name {} with id {} has status {}'.format(pod.metadata.name, pod.metadata.uid, status))
if status is None:
continue
if self.state_is_waiting(status.state):
Expand All @@ -167,6 +168,7 @@ def wait_for_completion(self):
w.stop()
else:
raise CalrissianJobException('Unexpected pod container status', status)
log.info('completion_result is {}', self.completion_result)
return self.completion_result

def _set_pod(self, pod):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pyparsing==2.4.2
python-dateutil==2.8.0
PyYAML==5.4
rdflib>=4.2.2,<5.1
requests==2.28.1
rdflib-jsonld==0.6.2
requests==2.22.0
requests-oauthlib==1.2.0
rsa==4.7
ruamel.yaml>=0.12.4,<=0.16.5
Expand Down

0 comments on commit 9f37598

Please sign in to comment.