-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove etcd #7
Remove etcd #7
Changes from 12 commits
d564bcb
9db9934
0701183
e63f4e4
c6e5282
b2fa311
45bc384
952f854
5cd42d9
562cd66
1b0dea4
88b9e7f
7f9af26
68ff390
139c67f
278485d
7c3b62a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
DOCKER_BUILD_TAG=0.9.1 | ||
DOCKER_BUILD_TAG=3.0.1-rc1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't fully agree with this VERSION file approach. Imho, git tag is much more reliable and obvious source of truth. As long as you have both, you will have inconsistencies between them. Take a look at this:
It's just a question of time when someone (like me) will forget to update the version file and - ooops - we have a wrong image. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import os | ||
from kafka import KafkaProducer | ||
from .comments_events_pb2 import UserCommentedOnVideo | ||
from common.common_types_conversions import UUID_to_grpc, datetime_to_Timestamp, TimeUUID_to_grpc | ||
|
@@ -8,7 +9,7 @@ class CommentsPublisher(object): | |
"""Provides methods that publish events associated with the Comments Service.""" | ||
|
||
def __init__(self): | ||
self.producer = KafkaProducer(bootstrap_servers='10.0.75.1:9092', | ||
self.producer = KafkaProducer(bootstrap_servers=os.getenv('KILLRVIDEO_KAFKA', 'kafka'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe, KILLRVIDEO_KAFKA_HOST or anything like that? KILLRVIDEO_KAFKA doesn't sound obvious enough. |
||
client_id='killrvideo-python:CommentsService') | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"SERVICE_PORT": 8899, | ||
"SERVICE_HOST": "10.0.75.1", | ||
"ETCD_PORT": 2379, | ||
"CONTACT_POINTS": ["10.0.75.1"], | ||
"DEFAULT_CONSISTENCY_LEVEL": "LOCAL_QUORUM" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
import os | ||
from kafka import KafkaProducer | ||
from .ratings_events_pb2 import UserRatedVideo | ||
from common.common_types_conversions import UUID_to_grpc, grpc_to_UUID, datetime_to_Timestamp, Timestamp_to_datetime | ||
|
@@ -9,7 +10,7 @@ class RatingPublisher(object): | |
"""Provides methods that publish events associated with the Ratings Service.""" | ||
|
||
def __init__(self): | ||
self.producer = KafkaProducer(bootstrap_servers='10.0.75.1:9092', | ||
self.producer = KafkaProducer(bootstrap_servers=os.getenv('KILLRVIDEO_KAFKA', 'kafka'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, KILLRVIDEO_KAFKA_HOST looks better imho. |
||
client_id='killrvideo-python:RatingsService') | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
import os | ||
import threading | ||
from kafka import KafkaConsumer | ||
from user_management.user_management_events_pb2 import UserCreated | ||
|
@@ -10,16 +11,13 @@ | |
USER_RATED_VIDEO_TOPIC = 'topic-kv-videoRating' | ||
YOUTUBE_VIDEO_ADDED_TOPIC = 'topic-kv-videoCreation' | ||
|
||
BOOTSTRAP_SERVERS = '10.0.75.1:9092' | ||
|
||
|
||
class SuggestedVideoKafkaConsumer(threading.Thread): | ||
def __init__(self, suggested_videos_consumer): | ||
threading.Thread.__init__(self) | ||
self.suggested_videos_consumer = suggested_videos_consumer | ||
|
||
def run(self): | ||
consumer = KafkaConsumer(bootstrap_servers=BOOTSTRAP_SERVERS, | ||
consumer = KafkaConsumer(bootstrap_servers=os.getenv('KILLRVIDEO_KAFKA', 'kafka'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, KILLRVIDEO_KAFKA_HOST looks better imho. |
||
client_id='killrvideo-python:SuggestedVideosService', | ||
fetch_max_wait_ms=10000) # poll every 10 seconds for new events | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
import os | ||
from kafka import KafkaProducer | ||
from .user_management_events_pb2 import UserCreated | ||
from common.common_types_conversions import UUID_to_grpc, datetime_to_Timestamp | ||
|
@@ -9,7 +10,7 @@ class UserManagementPublisher(object): | |
"""Provides methods that publish events associated with the User Management Service.""" | ||
|
||
def __init__(self): | ||
self.producer = KafkaProducer(bootstrap_servers='10.0.75.1:9092', | ||
self.producer = KafkaProducer(bootstrap_servers=os.getenv('KILLRVIDEO_KAFKA', 'kafka'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, KILLRVIDEO_KAFKA_HOST looks better imho. |
||
client_id='killrvideo-python:UserManagementService') | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import logging | ||
import os | ||
from kafka import KafkaProducer | ||
from .video_catalog_events_pb2 import YouTubeVideoAdded | ||
from common.common_types_conversions import UUID_to_grpc, datetime_to_Timestamp | ||
|
@@ -9,7 +10,7 @@ class VideoCatalogPublisher(object): | |
"""Provides methods that publish events associated with the Video Catalog Service.""" | ||
|
||
def __init__(self): | ||
self.producer = KafkaProducer(bootstrap_servers='10.0.75.1:9092', | ||
self.producer = KafkaProducer(bootstrap_servers=os.getenv('KILLRVIDEO_KAFKA', 'kafka'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, KILLRVIDEO_KAFKA_HOST looks better imho. |
||
client_id='killrvideo-python:VideoCatalogService') | ||
|
||
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link is not rendered by github. I think the markdown is not correct here.