Skip to content

Commit

Permalink
Merge pull request #199 from dragonchain/master
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
cheeseandcereal committed Sep 26, 2019
2 parents 241bdbc + 0c4e656 commit 0dbfd13
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.1
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.0.1

- **Bugs:**
- Fix a bug where the smart contract list and actual underlying data can become out of sync and crash the contract invoker
- **Packaging:**
- Adjust RAM usage of scheduler pod for L1s
- Update Redis to 5.0.6 in the helm deployment
- Remove unnecessarily configurable options from opensource-config.yaml

## 4.0.0

This update introduces a breaking change required by the switch from
Expand Down
11 changes: 11 additions & 0 deletions dragonchain/lib/dao/smart_contract_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def get_serial_contracts() -> List[smart_contract_model.SmartContractModel]:
Searches for serial contracts
Please note this function fetches all smart contract metadata from storage each time it is run, so should be used sparingly
"""
# First check and remove bad contracts or this function could fail
remove_bad_contracts()
serial_contracts = []
for sc_id in list_all_contract_ids():
sc_model = get_contract_by_id(sc_id)
Expand All @@ -65,6 +67,15 @@ def get_serial_contracts() -> List[smart_contract_model.SmartContractModel]:
return serial_contracts


def remove_bad_contracts() -> None:
"""Remove contract(s) from the index if its metadata doesn't exist"""
for sc_id in list_all_contract_ids():
try:
get_contract_by_id(sc_id)
except exceptions.NotFound:
redisearch.delete_document(index=redisearch.Indexes.smartcontract.value, doc_name=sc_id)


def add_smart_contract_index(contract: smart_contract_model.SmartContractModel) -> None:
"""Add the index for a smart contract"""
redisearch.put_document(redisearch.Indexes.smartcontract.value, contract.id, {"sc_name": contract.txn_type}, upsert=True)
Expand Down
12 changes: 6 additions & 6 deletions helm/dragonchain-k8s/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
{{- end }}
containers:
- name: {{ .Release.Name }}-webserver
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/webserver.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down Expand Up @@ -173,7 +173,7 @@ spec:
fsGroup: {{ .Values.runContainerGroup }}
containers:
- name: {{ .Release.Name }}-tx-processor
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/transaction_processor.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
fsGroup: {{ .Values.runContainerGroup }}
containers:
- name: {{ .Release.Name }}-contract-invoker
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/contract_invoker.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down Expand Up @@ -333,7 +333,7 @@ spec:
fsGroup: {{ .Values.runContainerGroup }}
containers:
- name: {{ .Release.Name }}-job-processor
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/job_processor.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down Expand Up @@ -412,7 +412,7 @@ spec:
fsGroup: {{ .Values.runContainerGroup }}
containers:
- name: {{ .Release.Name }}-bc-processor
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/broadcast_processor.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down Expand Up @@ -491,7 +491,7 @@ spec:
fsGroup: {{ .Values.runContainerGroup }}
containers:
- name: {{ .Release.Name }}-scheduler
image: "{{ .Values.dragonchain.image.registry }}/{{ .Values.dragonchain.image.repository }}:{{ .Values.dragonchain.image.version }}"
image: "{{ .Values.dragonchain.image.value }}"
command: ["sh"]
args: ["entrypoints/scheduler.sh"]
imagePullPolicy: {{ .Values.dragonchain.image.pullPolicy }}
Expand Down
12 changes: 6 additions & 6 deletions helm/dragonchain-k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ service:
runContainerUser: 1000
runContainerGroup: 1000

# Default stage for dragonchain should be prod
# Default storage mount location
dragonchain:
image:
stage: prod
storage:
mount: "/dragonchain"

# Mountpath location for secret storage.
secret:
Expand All @@ -32,7 +32,7 @@ secret:
redis:
image:
repository: docker.io/redis
tag: 5.0.5-alpine
tag: 5.0.6-alpine

# LRU Cache Redis Configuration
cacheredis:
Expand Down Expand Up @@ -104,10 +104,10 @@ scheduler:
resources:
limits:
cpu: 100m
memory: 128Mi
memory: 64Mi
requests:
cpu: 20m
memory: 128Mi
memory: 64Mi

# Scheduler configuration
jobProcessor:
Expand Down
29 changes: 4 additions & 25 deletions helm/opensource-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,16 @@ dragonchain:
# Just keep in mind that Always with a 'latest' tag means your node may receive unexpected updates
pullPolicy: Always

# -- dragonchain.image.registry --
# This value should be registry at which your dragonchain image is stored.
# e.g.: docker.io
registry: docker.io

# -- dragonchain.image.repository --
# This value should be the name of the repository inside the registry which house your dragonchain image
# e.g.: {registry}/{repository}:{version}
repository: dragonchain/dragonchain_core

# -- dragonchain.image.version --
# Version of your dragonchain. This value is used to interpolate the tag name.
# e.g.: {registry}/{repository}:{version}
# -- dragonchain.image.value --
# The image to use as the dragonchain core image
# Check here for available tags: https://hub.docker.com/r/dragonchain/dragonchain_core/tags
# PLEASE USE A PINNED VERSION, AND NOT 'latest' FOR PRODUCTION DEPLOYMENTS
version: latest
value: docker.io/dragonchain/dragonchain_core:latest

# -- dragonchain.storage --
# The mount path of a persistent volume to be used by all dragonchain microservices.
# This is where your actual blockchain data will be stored at-rest
storage:
mount: "/dragonchain" # Don't change this value
spec:
# Switch storage class name to something usable within your cluster. Minikube accepts 'standard'
storageClassName: standard
Expand All @@ -109,11 +97,6 @@ redis:
resources:
requests:
storage: 1Gi
# -- redis.image --
# This is the image that dragonchain uses for a persistent and LRU redis
image:
repository: docker.io/redis
tag: 5.0.5-alpine

redisearch:
# -- redis.storage --
Expand All @@ -128,10 +111,6 @@ redisearch:
resources:
requests:
storage: 1Gi
# -- redis.image --
# This is the image that dragonchain uses for the redisearch used for indexing
image:
repository: docker.io/redislabs/redisearch
tag: 1.4.16

# For more information on kubernetes storage, view the docs: https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/
# PersistentVolumeClaimSpec API Reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#persistentvolumeclaimspec-v1-core
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cache_dir=.mypy_cache
# flake8-mypy expects the two following for sensible formatting
show_column_numbers=True
show_error_context=False
no_error_summary=True

# suppress warnings about unsatisfied imports
follow_imports=silent
Expand Down

0 comments on commit 0dbfd13

Please sign in to comment.