Giter VIP home page Giter VIP logo

Comments (11)

wsobel avatar wsobel commented on August 20, 2024

from cppagent_dev.

skibum1869 avatar skibum1869 commented on August 20, 2024
Devices = ./devices/MazakSample.xml

ServerIP = 0.0.0.0
Port = 5000
AllowPut = true
AllowPutFrom = localhost

ReconnectInterval = 1000
WorkerThreads = 2
# MinimumConfigReloadAge = 30
BufferSize = 17
MaxAssets = 10

SchemaVersion = 2.0
ShdrVersion = 2.0 # Set Default on all Adapters
SuppressIPAddress = false

TlsCertificateChain = NULL
TlsOnly = false

MonitorConfigFiles = true
ConversionRequired = true
UpcaseDataItemValue = true
Pretty = true

Adapters {
    # Standard Adapter Feed
    # dev {
    #     Host = 127.0.0.1 # define the IP address. 
    #     Port = 7878
    #     ShdrVersion = 2.0 # Define per Adapter
    # }
    # Agent Adapter Feed
    HCN001 {
        Url = http://mtconnect.mazakcorp.com:5719/
        SourceDevice = HCN001
    }
}



Files {
    schemas {
        Path = /etc/MTC_Agent/schemas
        Location = /schemas/
    }
    styles {
        Path = /etc/MTC_Agent/styles
        Location = /styles/
    }
    Favicon {
        Path = /etc/MTC_Agent/styles
        Location = /styles/
    }
}

Ruby {
 module =  /etc/MTC_Agent/ruby/module.rb
}

DevicesStyle { Location = /styles/styles.xsl }
StreamsStyle { Location = /styles/styles.xsl }

logger_config {
    logging_level = info #trace, debug, info, warn, error, or fatal
    output = cout
}

from cppagent_dev.

skibum1869 avatar skibum1869 commented on August 20, 2024

Looks like the path is incorrect in the test above, it still is crashing with the correct path to the schemas ill send an updated log when it finishes recompiling.

from cppagent_dev.

skibum1869 avatar skibum1869 commented on August 20, 2024

Output isnt giving everything. so ill update when i get a clean output like before.

#!/bin/sh
### Ubuntu Version


# ---- Ubuntu instance ----
FROM ubuntu:22.04 AS ubuntu-base
ENV DEBIAN_FRONTEND=noninteractive


# ---- Ubuntu make ----
FROM ubuntu-base AS ubuntu-core
ENV PythonVersion=3.10
ENV PATH=$HOME/venv$PythonVersion/bin:$PATH

RUN apt-get clean \
	&& apt-get update \
	&& apt-get install -y \
	build-essential python$PythonVersion python3-pip git cmake make rake\
	&& python$PythonVersion -m pip install conan


COPY ./.ssh/ /root/.ssh/
RUN	chmod 600 /root/.ssh/id_rsa \
	&& git clone --recurse-submodules --progress --depth 1 [email protected]:mtconnect/cppagent_dev.git /app_build/
# RUN	git clone --recurse-submodules --progress https://github.com/mtconnect/cppagent.git --depth 1 /app_build/

RUN cd /app_build/ \
	&& conan export conan/mqtt_cpp/ \
	&& conan export conan/mruby/ 
	
RUN cd /app_build/ \
	&& conan install . -if build --build=missing \
	-pr conan/profiles/docker \
	-o run_tests=True \
	-o with_ruby=True

RUN	cd /app_build/ \
	&& conan build . -bf build


# ---- Release ----
### Create folders, copy device files and dependencies for the release
FROM ubuntu-base AS ubuntu-release
LABEL author="skibum1869" description="Docker image for the latest Development MTConnect C++ Agent supplied \
from the MTConnect Institute"
EXPOSE 5000:5000/tcp

RUN apt-get clean \
	&& apt-get update \
	&& apt-get install -y ruby

# change to a new non-root user for better security.
# this also adds the user to a group with the same name.
# --create-home creates a home folder, ie /home/<username>
RUN useradd --create-home agent
USER agent
WORKDIR /etc/MTC_Agent/

# install agent executable
COPY --chown=agent:agent --from=ubuntu-core app_build/build/bin/agent /usr/local/bin/

# copy custom data files and folders to /etc/MTC_Agent/*
COPY --chown=agent:agent agent.cfg /etc/MTC_Agent/
COPY --chown=agent:agent docker-entrypoint.sh /etc/MTC_Agent/
COPY --chown=agent:agent ./Devices/ /etc/MTC_Agent/devices/
COPY --chown=agent:agent ./Assets/ /etc/MTC_Agent/assets
Copy --chown=agent:agent ./Ruby/ /etc/MTC_Agent/ruby

# copy data from the cppagent repo to /etc/MTC_Agent/*
COPY --chown=agent:agent --from=ubuntu-core app_build/simulator/ /etc/MTC_Agent/simulator
COPY --chown=agent:agent --from=ubuntu-core app_build/schemas/ /etc/MTC_Agent/schemas
COPY --chown=agent:agent --from=ubuntu-core app_build/styles/ /etc/MTC_Agent/styles

RUN chmod +x /usr/local/bin/agent && \
	chmod +x /etc/MTC_Agent/docker-entrypoint.sh
ENTRYPOINT ["/bin/sh", "-x", "/etc/MTC_Agent/docker-entrypoint.sh"]

### EOF

from cppagent_dev.

skibum1869 avatar skibum1869 commented on August 20, 2024
+ agent run agent.cfg
Loading configuration from:"/etc/MTC_Agent/agent.cfg"terminate called after throwing an instance of 'std::runtime_error'

      <ComponentStream component="Linear" name="Z" componentId="z">
        <Samples>
          <Position dataItemId="Zabs" sequence="2266657" subType="ACTUAL" timestamp="2022-07-12T13:03:21.7663Z">-743.93095</Position>
          <Position dataItemId="Zabs" sequence="2266674" subType="ACTUAL" timestamp="2022-07-12T13:03:22.5991Z">-715.4034</Position>
          <Position dataItemId="Zabs" sequence="2266693" subType="ACTUAL" timestamp="2022-07-12T13:03:23.0195Z">-730.36275</Position>
          <Position dataItemId="Zabs" sequence="2266701" subType="ACTUAL" timestamp="2022-07-12T13:03:23.4409Z">-737.99945</Position>
          <Position dataItemId="Zabs" sequence="2266706" subType="ACTUAL" timestamp="2022-07-12T13:03:23.8493Z">-750.79285</Position>
          <Position dataItemId="Zabs" sequence="2266709" subType="ACTUAL" timestamp="2022-07-12T13:03:24.2667Z">-763.5862</Position>
          <Position dataItemId="Zabs" sequence="2266719" subType="ACTUAL" timestamp="2022-07-12T13:03:24.6781Z">-773.4034</Position>
          <Position dataItemId="Zabs" sequence="2267090" subType="ACTUAL" timestamp="2022-07-12T13:04:03.3498Z">-768.95175</Position>
          <Position dataItemId="Zabs" sequence="2267106" subType="ACTUAL" timestamp="2022-07-12T13:04:03.7793Z">-715.4034</Position>
          <Position dataItemId="Zabs" sequence="2267124" subType="ACTUAL" timestamp="2022-07-12T13:04:04.2077Z">-729.07315</Position>
          <Position dataItemId="Zabs" sequence="2267132" subType="ACTUAL" timestamp="2022-07-12T13:04:04.615Z">-740.13165</Position>
          <Position dataItemId="Zabs" sequence="2267136" subType="ACTUAL" timestamp="2022-07-12T13:04:05.0244Z">-752.2143</Position>
          <Position dataItemId="Zabs" sequence="2267140" subType="ACTUAL" timestamp="2022-07-12T13:04:05.4318Z">-765.0077</Position>
          <Position dataItemId="Zabs" sequence="2267150" subType="ACTUAL" timestamp="2022-07-12T13:04:06.2466Z">-773.4034</Position>
          <AxisFeedrate dataItemId="Zfrt" sequence="2266656" timestamp="2022-07-12T13:03:21.7663Z">3.447934943752</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2266673" timestamp="2022-07-12T13:03:22.5991Z">0</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2266692" timestamp="2022-07-12T13:03:23.0195Z">1.888424526664</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2266700" timestamp="2022-07-12T13:03:23.4409Z">24.9863038412</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2266718" timestamp="2022-07-12T13:03:24.6781Z">0</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267089" timestamp="2022-07-12T13:04:03.3498Z">24.343581284464</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267105" timestamp="2022-07-12T13:04:03.7793Z">0</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267123" timestamp="2022-07-12T13:04:04.2077Z">2.982817149208</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267131" timestamp="2022-07-12T13:04:04.615Z">24.9863038412</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267139" timestamp="2022-07-12T13:04:05.4318Z">24.9845472448</AxisFeedrate>
          <AxisFeedrate dataItemId="Zfrt" sequence="2267149" timestamp="2022-07-12T13:04:06.2466Z">0</AxisFeedrate>
          <Load dataItemId="Zload" sequence="2266521" timestamp="2022-07-12T13:03:10.2143Z">4</Load>
          <Load dataItemId="Zload" sequence="2266527" timestamp="2022-07-12T13:03:10.6207Z">1</Load>
          <Load dataItemId="Zload" sequence="2266537" timestamp="2022-07-12T13:03:11.8709Z">4</Load>
          <Load dataItemId="Zload" sequence="2266549" timestamp="2022-07-12T13:03:13.092Z">1</Load>
          <Load dataItemId="Zload" sequence="2266559" timestamp="2022-07-12T13:03:14.7276Z">4</Load>
          <Load dataItemId="Zload" sequence="2266655" timestamp="2022-07-12T13:03:21.7663Z">199</Load>
          <Load dataItemId="Zload" sequence="2266672" timestamp="2022-07-12T13:03:22.5991Z">3</Load>
          <Load dataItemId="Zload" sequence="2266691" timestamp="2022-07-12T13:03:23.0195Z">120</Load>
          <Load dataItemId="Zload" sequence="2266699" timestamp="2022-07-12T13:03:23.4409Z">5</Load>
          <Load dterminate called after throwing an instance of 'std::runtime_error'
  what():  cannot find boundary
Aborted (core dumped)

from cppagent_dev.

wsobel avatar wsobel commented on August 20, 2024

Looks like it is missing part of the XML from mazak and the parser threw out. I'll try to reproduce and see if I can get the same error. Are you going through a proxy? Any other details would be helpful. This could be a framing error or a chunking problem.

from cppagent_dev.

wsobel avatar wsobel commented on August 20, 2024

Cannot find a boundary indicates a framing issue. Do you know if this is the first frame received or if any data was getting through?

from cppagent_dev.

skibum1869 avatar skibum1869 commented on August 20, 2024

No proxy just straight from docker container above using docker run agent --it -p=5000-5010/5000tcp some data is getting through, this has just started to occur in build 10 as it doesn't seem to have this issue in build 9

from cppagent_dev.

wsobel avatar wsobel commented on August 20, 2024

strange, no changes to the code handling the agent adapter. file monitoring was added. I'll take a closer look.

from cppagent_dev.

wsobel avatar wsobel commented on August 20, 2024

I'm able to reproduce the issue... now for the fun part.

from cppagent_dev.

wsobel avatar wsobel commented on August 20, 2024

Found two issues that were impacting each other. there was a parsing issue just introduced when we improved support for numeric events and JSON. The other was high volume data was not handled correctly when looking the mime header. Needed to make sure a minimum amount of data was available.

from cppagent_dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.