Skip to content

Commit c2ee5fa

Browse files
authored
Merge pull request #85 from vsoch/development
Development
2 parents c6aa834 + 19511f6 commit c2ee5fa

File tree

9 files changed

+80
-3
lines changed

9 files changed

+80
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and changes prior to that are (unfortunately) done retrospectively. Critical ite
1515

1616
## [vxx](https://github.com/singularityware/singularity-python/tree/development) (development)
1717

18+
**changed user experience**
19+
- to address this [sregisty issue](https://github.com/singularityhub/sregistry/issues/56) the push client does not always state that the upload is finished. In the case that an image is frozen (and 403 status) this message is misleading.
20+
**pull bug**
21+
- changing function to rename image after download to `shutil.move` to allow for cross device downloads.
1822

1923
## [v2.4.1](https://github.com/singularityware/singularity-python/releases/tag/v2.4.1) (v2.4.1)
2024

Singularity.container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ git clone -b development https://www.github.com/vsoch/singularity-python
2525
cd singularity-python
2626
/opt/conda/bin/pip install setuptools
2727
/opt/conda/bin/pip install -r requirements.txt
28-
/opt/conda/bin/pip install pyasn1==0.3.4
28+
/opt/conda/bin/pip install pyasn1==0.4.1
2929
/opt/conda/bin/python setup.py sdist
3030
/opt/conda/bin/python setup.py install

examples/docker/.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
examples/*
2+
examples
3+
build
4+
*.simg
5+
*.img
6+
dist
7+
*.egg.info

examples/docker/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM continuumio/miniconda3
2+
3+
# docker build -t vanessa/singularity-python .
4+
5+
ENV PATH /opt/conda/bin:$PATH
6+
LABEL maintainer [email protected]
7+
8+
RUN apt-get update && apt-get install -y git && \
9+
/opt/conda/bin/conda install -y numpy scikit-learn cython pandas
10+
11+
WORKDIR /opt
12+
RUN git clone -b development https://www.github.com/vsoch/singularity-python
13+
WORKDIR singularity-python
14+
RUN /opt/conda/bin/pip install setuptools && \
15+
/opt/conda/bin/pip install -r requirements.txt && \
16+
/opt/conda/bin/pip install pyasn1==0.4.1 && \
17+
/opt/conda/bin/python setup.py sdist && \
18+
/opt/conda/bin/python setup.py install && \
19+
apt-get clean

examples/docker/Dockerfile.shub

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM vanessa/singularity-python:2.4.1
2+
LABEL VERSION 2.4.1
3+
CMD ["/opt/conda/bin/shub"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM vanessa/singularity-python:2.4.1
2+
LABEL VERSION 2.4.1
3+
CMD ["/opt/conda/bin/sregistry"]

examples/docker/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Docker images
2+
3+
These docker images are meant to provide a client for [Singularity Hub](Dockerfile.shub)
4+
and [Singularity Registry](Dockerfile.sregistry), respectively. These images are provided on [Docker Hub](https://hub.docker.com/r/vanessa/singularity-python/).
5+
6+
7+
## Singuarity Python Base
8+
9+
**build**
10+
```
11+
docker build -t vanessa/singularity-python .
12+
docker tag vanessa/singularity-python vanessa/singularity-python:2.4.1
13+
docker push vanessa/singularity-python:2.4.1
14+
```
15+
16+
## Singularity Client
17+
18+
**build**
19+
```
20+
docker build -f Dockerfile.shub -t vanessa/singularity-python:shub-2.4.1 .
21+
docker push vanessa/singularity-python:shub-2.4.1
22+
```
23+
24+
**usage**
25+
```
26+
docker run vanessa/singularity-python:shub-2.4.1
27+
```
28+
29+
## Singularity Registry Client
30+
31+
**build**
32+
```
33+
docker build -f Dockerfile.sregistry -t vanessa/singularity-python:sreg-2.4.1 .
34+
docker push vanessa/singularity-python:sreg-2.4.1
35+
```
36+
37+
**usage**
38+
```
39+
docker run vanessa/singularity-python:sreg-2.4.1
40+
```

singularity/hub/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from requests.exceptions import HTTPError
2828

2929
from singularity.logger import bot
30+
import shutil
3031
import requests
3132
import tempfile
3233
import json
@@ -154,7 +155,7 @@ def download(self,url,file_name,headers=None,show_progress=True):
154155
if isinstance(response, HTTPError):
155156
bot.error("Error downloading %s, exiting." %url)
156157
sys.exit(1)
157-
os.rename(tmp_file, file_name)
158+
shutil.move(tmp_file, file_name)
158159
return file_name
159160

160161

singularity/registry/client/push.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def push(self, path, name, tag=None, compress=False):
129129
r = requests.post(url, data=monitor, headers=headers)
130130
message = self.read_response(r)
131131

132-
print('\nUpload finished! [Return status {0} {1}]'.format(r.status_code, message))
132+
print('\n[Return status {0} {1}]'.format(r.status_code, message))
133133

134134
except KeyboardInterrupt:
135135
print('\nUpload cancelled.')

0 commit comments

Comments
 (0)