Fixed startnode button showing for startnode
This commit is contained in:
@@ -3667,6 +3667,25 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os.
|
||||
continue
|
||||
}
|
||||
|
||||
readmeNames := []string{"readme", "readme.md"}
|
||||
for _, readmeName := range readmeNames {
|
||||
readmePath := fmt.Sprintf("%s/%s", extra, readmeName)
|
||||
readmeInfo, err := fs.Open(readmePath)
|
||||
if err != nil {
|
||||
log.Printf("[WARNING] Failed to read README path %s", readmePath)
|
||||
continue
|
||||
}
|
||||
|
||||
dockerfileData, err := ioutil.ReadAll(dockerfile)
|
||||
if err != nil {
|
||||
log.Printf("[WARNING] Failed to read readme file at %s", readmePath)
|
||||
continue
|
||||
} else {
|
||||
log.Printf("[INFO] Found file with name %s", readmeName)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
combined := []byte{}
|
||||
combined = append(combined, appfileData...)
|
||||
combined = append(combined, appPythonData...)
|
||||
|
||||
@@ -1500,7 +1500,7 @@ const ParsedAction = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
<div style={{display: "flex", flexDirection: "column",}}>
|
||||
{selectedAction.id === workflow.start ? null :
|
||||
{/*selectedAction.id === workflow.start ? null :
|
||||
<Tooltip color="primary" title={"Make this node the start action"} placement="top">
|
||||
<Button style={{zIndex: 5000, marginTop: 10,}} color="primary" variant="outlined" onClick={(e) => {
|
||||
defineStartnode(e)
|
||||
@@ -1508,7 +1508,7 @@ const ParsedAction = (props) => {
|
||||
<KeyboardArrowRightIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
}
|
||||
*/}
|
||||
{selectedApp.versions !== null && selectedApp.versions !== undefined && selectedApp.versions.length > 1 ?
|
||||
<Select
|
||||
defaultValue={selectedAction.app_version}
|
||||
|
||||
@@ -3212,6 +3212,10 @@ const AngularWorkflow = (props) => {
|
||||
if (parentNode.data('isButton') || parentNode.data('buttonId'))
|
||||
return
|
||||
|
||||
if (parentNode.data("isStartNode")) {
|
||||
return
|
||||
}
|
||||
|
||||
//parentNode.lock()
|
||||
const px = parentNode.position('x') - 65
|
||||
const py = parentNode.position('y') - 45
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
version: "2"
|
||||
|
||||
version: '2'
|
||||
services:
|
||||
zookeeper:
|
||||
image: docker.io/bitnami/zookeeper:3
|
||||
image: wurstmeister/zookeeper
|
||||
ports:
|
||||
- "2181:2181"
|
||||
volumes:
|
||||
- "zookeeper_data:/bitnami"
|
||||
environment:
|
||||
- ALLOW_ANONYMOUS_LOGIN=yes
|
||||
kafka:
|
||||
image: docker.io/bitnami/kafka:2
|
||||
build: .
|
||||
ports:
|
||||
- "9092:9092"
|
||||
volumes:
|
||||
- "kafka_data:/bitnami"
|
||||
- "9092"
|
||||
environment:
|
||||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
depends_on:
|
||||
- zookeeper
|
||||
|
||||
volumes:
|
||||
zookeeper_data:
|
||||
driver: local
|
||||
kafka_data:
|
||||
driver: local
|
||||
DOCKER_API_VERSION: 1.40
|
||||
KAFKA_ADVERTISED_HOST_NAME: 192.168.193.140
|
||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
@@ -11,44 +11,77 @@ shuffle_workflow = os.getenv("SHUFFLE_WORKFLOW")
|
||||
|
||||
headers = {"Authorization": "Bearer %s" % shuffle_apikey}
|
||||
topic = "workflow_%s" % shuffle_workflow
|
||||
group = "testing"
|
||||
server = "localhost:9092"
|
||||
def produce():
|
||||
print("Starting producer")
|
||||
producer = KafkaProducer(
|
||||
bootstrap_servers=[server],
|
||||
value_serializer=lambda x:
|
||||
json.dumps(x).encode('utf-8')
|
||||
)
|
||||
|
||||
print("Adding data!")
|
||||
for e in range(15):
|
||||
data = {"some": e, "data": "luuuuul"}
|
||||
try:
|
||||
#group_id=group,
|
||||
#value_serializer=lambda x: json.dumps(x).encode('utf-8')
|
||||
producer = KafkaProducer(
|
||||
bootstrap_servers=[server],
|
||||
)
|
||||
except kafka.errors.NoBrokersAvailable as e:
|
||||
print(f"Error with producer: {e}")
|
||||
sleep(5)
|
||||
produce()
|
||||
return
|
||||
except ValueError as e:
|
||||
print(f"ValuError with producer: {e}")
|
||||
sleep(5)
|
||||
produce()
|
||||
return
|
||||
|
||||
|
||||
for i in range(15):
|
||||
producer.send(topic, json.dumps({"some": i, "data": "luuuuul"}))
|
||||
|
||||
try:
|
||||
ret = producer.send(topic, value=data)
|
||||
print(ret.get())
|
||||
except kafka.errors.KafkaTimeoutError as e:
|
||||
print("Kafka error: %s" % e)
|
||||
continue
|
||||
producer.flush()
|
||||
producer.close()
|
||||
exit()
|
||||
|
||||
#print(f"Adding data {data}")
|
||||
|
||||
#try:
|
||||
# ret = producer.send(topic, value=data)
|
||||
# print(ret.get())
|
||||
# producer.flush()
|
||||
|
||||
# #future = producer.send('foobar', b'another_message')
|
||||
# #result = future.get(timeout=60)
|
||||
# #print(result)
|
||||
|
||||
#except kafka.errors.KafkaTimeoutError as e:
|
||||
# print("Kafka error: %s" % e)
|
||||
# continue
|
||||
|
||||
def consume():
|
||||
print("Starting consumer")
|
||||
#group_id=group,
|
||||
#auto_offset_reset="earliest",
|
||||
#enable_auto_commit=True,
|
||||
consumer = KafkaConsumer(
|
||||
topic,
|
||||
bootstrap_servers=[server],
|
||||
auto_offset_reset="earliest",
|
||||
enable_auto_commit=True,
|
||||
value_deserializer=lambda x: json.loads(x.decode('utf-8'))
|
||||
auto_offset_reset='earliest',
|
||||
max_poll_records=2,
|
||||
)
|
||||
#value_deserializer=lambda x: json.loads(x.decode('utf-8'))
|
||||
|
||||
print("Getting data")
|
||||
consumer.poll()
|
||||
#consumer.seek_to_beginning()
|
||||
|
||||
print(f"Getting data from topic {topic}")
|
||||
for message in consumer:
|
||||
message = message.value
|
||||
#message = message.value
|
||||
#message = message
|
||||
print("MSG: ", message)
|
||||
ret = requests.post("%s/api/v1/%s/execute" % shuffle_url, headers=headers, data=message)
|
||||
print(ret.status_code)
|
||||
print(ret.text)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if topic == "workflow_None":
|
||||
topic = "testing"
|
||||
print("Starting producer on %s for topic %s" % (server, topic))
|
||||
produce()
|
||||
#consume()
|
||||
|
||||
Reference in New Issue
Block a user