Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Feature/renaming #378

Closed
wants to merge 7 commits into from
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ containers or as virtual machines.
| ingesters | Split the Crypt4GH header and move the remainder to the storage backend. No cryptographic task, nor connection to the keyserver. |
jbygdell marked this conversation as resolved.
Show resolved Hide resolved
| verifiers | Connect to the keyserver (via SSL) and decrypt the stored files and checksum them against their embedded checksum. |
| vault | Storage backend: as a regular file system or as a S3 object store. |
| ID mapper | Handles the so-called _Stable ID_ filename mappings from CentralEGA. |
| Finalize | Handles the so-called _Stable ID_ filename mappings from CentralEGA. |

Find the [LocalEGA documentation](http://localega.readthedocs.io) hosted on [ReadTheDocs.org](https://readthedocs.org/).
28 changes: 14 additions & 14 deletions deploy/bootstrap/lega.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ chroot_sessions = True

[vault]
driver = S3Storage
url = http://s3:9000
url = http://vault:9000
jbygdell marked this conversation as resolved.
Show resolved Hide resolved
access_key = ${S3_ACCESS_KEY}
secret_key = ${S3_SECRET_KEY}
#region = lega
Expand Down Expand Up @@ -235,20 +235,20 @@ fi

cat >> ${PRIVATE}/lega.yml <<EOF
# Stable ID mapper
id-mapper:
finalize:
silverdaz marked this conversation as resolved.
Show resolved Hide resolved
depends_on:
- db
- mq
image: nbisweden/ega-base:dev
container_name: id-mapper
container_name: finalize
labels:
lega_label: "id-mapper"
lega_label: "finalize"
volumes:
- ./lega/conf.ini:/etc/ega/conf.ini:ro
restart: on-failure:3
networks:
- lega
entrypoint: ["gosu", "lega", "ega-id-mapper"]
entrypoint: ["gosu", "lega", "ega-finalize"]

# Ingestion Workers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are renaming both id-mapper to finalize and s3 to vault.
You should say that in the body of the commit message, if there would have been two separate commits then the same information would have fit in then commit title.

ingest:
Expand Down Expand Up @@ -358,7 +358,7 @@ cat >> ${PRIVATE}/lega.yml <<EOF
# Data Out re-encryption service
res:
depends_on:
- s3
- vault
- keys
hostname: res
container_name: res
Expand All @@ -379,26 +379,26 @@ cat >> ${PRIVATE}/lega.yml <<EOF
- EGA_SHAREDPASS_PATH=/etc/ega/pgp/ega.shared.pass
- EGA_EBI_AWS_ACCESS_KEY=${S3_ACCESS_KEY}
- EGA_EBI_AWS_ACCESS_SECRET=${S3_SECRET_KEY}
- EGA_EBI_AWS_ENDPOINT_URL=http://s3:${DOCKER_PORT_s3}
- EGA_EBI_AWS_ENDPOINT_URL=http://vault:${DOCKER_PORT_s3}
jbygdell marked this conversation as resolved.
Show resolved Hide resolved
- EGA_EBI_AWS_ENDPOINT_REGION=
volumes:
- ./lega/pgp/ega.shared.pass:/etc/ega/pgp/ega.shared.pass:ro
restart: on-failure:3
networks:
- lega

# S3
s3:
hostname: s3
container_name: s3
# Storage backend: S3
vault:
hostname: vault
container_name: vault
labels:
lega_label: "s3"
lega_label: "vault"
image: minio/minio
environment:
- MINIO_ACCESS_KEY=${S3_ACCESS_KEY}
- MINIO_SECRET_KEY=${S3_SECRET_KEY}
volumes:
- s3:/data
- vault:/data
restart: on-failure:3
networks:
- lega
Expand All @@ -410,7 +410,7 @@ cat >> ${PRIVATE}/lega.yml <<EOF
volumes:
db:
inbox:
s3:
vault:
EOF

#########################################################################
Expand Down
2 changes: 1 addition & 1 deletion deploy/tests/src/test/resources/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ container.label.inbox = inbox
container.label.ingest = ingest
container.label.keys = keys
container.label.mq = mq
container.label.s3 = s3
container.label.s3 = vault
jbygdell marked this conversation as resolved.
Show resolved Hide resolved
container.label.verify = verify
4 changes: 2 additions & 2 deletions docs/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Python Modules
lega.ingest
lega.verify
lega.keyserver
lega.mapper
lega.finalize

*******************
Inbox notifications
Expand All @@ -31,7 +31,7 @@ Ingestion Worker
:members:
.. automodule:: lega.verify
:members:
.. automodule:: lega.mapper
.. automodule:: lega.finalize
:members:


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'ega-verify = lega.verify:main',
'ega-keyserver = lega.keyserver:main',
'ega-notifications = lega.notifications:main',
'ega-id-mapper = lega.mapper:main',
'ega-finalize = lega.finalize:main',
'ega-conf = lega.conf.__main__:main',
]
},
Expand Down
18 changes: 9 additions & 9 deletions tests/test_mapper.py → tests/test_finalize.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import unittest
from lega.mapper import main, work
from lega.finalize import main, work
from unittest import mock


class testMapper(unittest.TestCase):
"""Mapper.
class testFinalize(unittest.TestCase):
"""Finalize.

Testing mapper functionalities.
Testing Finalizer functionalities.
"""

def setUp(self):
Expand All @@ -17,18 +17,18 @@ def tearDown(self):
"""Remove anything that was setup."""
pass

@mock.patch('lega.mapper.db')
@mock.patch('lega.finalize.db')
def test_work(self, mock_db):
"""Test mapper worker, should insert into database."""
"""Test finalize worker, should insert into database."""
# mock_db.set_stable_id.return_value = mock.Mock()
data = {'stable_id': '1', 'file_id': '123'}
work(data)
mock_db.set_stable_id.assert_called_with('123', '1')

@mock.patch('lega.mapper.get_connection')
@mock.patch('lega.mapper.consume')
@mock.patch('lega.finalize.get_connection')
@mock.patch('lega.finalize.consume')
def test_main(self, mock_consume, mock_connection):
"""Test main mapper, by mocking cosume call."""
"""Test main finalize, by mocking cosume call."""
mock_consume.return_value = mock.MagicMock()
main()
mock_consume.assert_called()